app\config\app:
Код: Выделить всё
namespace Config;
use CodeIgniter\Config\BaseConfig;
class App extends BaseConfig
{
/**
* --------------------------------------------------------------------------
* Base Site URL
* --------------------------------------------------------------------------
*
* URL to your CodeIgniter root. Typically this will be your base URL,
* WITH a trailing slash:
*
* http://example.com/
*
* If this is not set then CodeIgniter will try guess the protocol, domain
* and path to your installation. However, you should always configure this
* explicitly and never rely on auto-guessing, especially in production
* environments.
*
* @var string
*/
public $baseURL = 'http://local.example.com/';
public function __construct()
{
if ($_SERVER['SERVER_NAME']== 'local.example.com') {
$this->baseURL = 'http://local.example.com/';
}
}
...
Код: Выделить всё
class Database extends Config
{
/**
* The directory that holds the Migrations
* and Seeds directories.
*
* @var string
*/
public $filesPath = APPPATH . 'Database' . DIRECTORY_SEPARATOR;
/**
* Lets you choose which connection group to
* use if no other is specified.
*
* @var string
*/
public $defaultGroup = 'default';
/**
* The default database connection.
*
* @var array
*/
public $default = [
'DSN' => '',
'hostname' => '127.0.0.1',
'username' => 'root',
'password' => '',
'database' => '*database name on phpmyadmin*',
'DBDriver' => 'MySQLi',
'DBPrefix' => '',
'pConnect' => false,
'DBDebug' => (ENVIRONMENT !== 'production'),
'charset' => 'utf8',
'DBCollat' => 'utf8_general_ci',
'swapPre' => '',
'encrypt' => false,
'compress' => false,
'strictOn' => false,
'failover' => [],
'port' => 3306,
];
...
Код: Выделить всё
ServerName local.example.com
DocumentRoot "C:\xxxxx\xxxxx\Desktop\XAMPP Folder\htdocs\xxxxxx\public"
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
# LimitRequestBody 10737418240
Код: Выделить всё
127.0.0.1 local.example.com
# localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
::1 localhost
127.0.0.1 local.example.com
Мне также удалось обойти ошибку по умолчанию, выполнив ini_set(display_error) , 1) в app\config\Boot\production. Это дало мне эту ошибку:
Ошибка
Подробнее здесь: https://stackoverflow.com/questions/790 ... s-intended