Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
the db.php file in config/development and the db.php file in confif folder
  • please help me!

    I have two the db.php file as above the title.

    But when i config file the db.php file in config/development folder it not working. And the project used to the db.php file in config folder. I don't understand why?

    I have declare ENV in the bootstrap file as below:

    Fuel::$env = (isset($_SERVER['FUEL_ENV']) ? $_SERVER['FUEL_ENV'] : Fuel::DEVELOPMENT);
  • What prints "var_dump(Fuel::$env)" after the line "Fuel::$env = (isset..." in bootstrap file ?
  • Remember that the config/db.php and config/<your-environment/db.php are merged to create a single config file.

    So you should only put global defaults in config/db.php, and nothing else. if you say it uses info from db.php, perhaps you've put a database config in there (which you should not do)?
  • @syntaxlb
    result for var_dump(Fuel::$env) is "development"

    @Harro Verton
    i'm config two db.php as below
    1. app/config/development:

    return array(
    'default' => array(
    'connection'  => array(
    return array(
    'active' => 'default',
    'default' => array(
      'type'        => 'mysql',
      'connection'  => array(
      'identifier'   => '`',
      'table_prefix' => "",
      'charset'      => 'utf8',
  • That doesn't help much, since you've cut out all relevant information.

    In your controller, do:
    \Config::load('db', true);

    and post the result on Add both config/db.php and config/development.php too, and post that link here (will be a lot easier to read). (replace username and password by *****)

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion