2.8.4.6.2. Configure database connection in CodeIgniter

Attention!

The connection will not work with the host localhost. You need to use the host address provided in the database connection details.

Database connection details in CodeIgniter are specified in the database configuration file:

  • If you are using an .env file, you need to modify the lines after first removing the hash symbol # at the beginning of each line:
    database.default.hostname = host
    database.default.database = database
    database.default.username = username
    database.default.password = password
    database.default.DBDriver = MySQLi
    database.default.DBPrefix =
    database.default.port = 3306
  • If you are using the file app/Config/Database.php, you need to modify the following lines:
    public $default = [
            'hostname' => 'host',
            'username' => 'login',
            'password' => 'password',
            'database' => 'database',
            'DBDriver' => 'MySQLi',
            'DBPrefix' => '',
            ...
            'port'     => 3306,
        ];

You can select the desired PHP version by following the instruction.

You can edit files using the file manager or any FTP client.

Змест