gustavgans
gustavgans

Reputation: 5191

Change database connect on production server

where can I change the database connection on my production server? I changed it here fuel/app/config/production/db.php. But how does fuelphp know which settings it should use?

I'm using nginx as webserver on Ubuntu.

The error message is:

1045!

Fuel\Core\Database_Exception [ 1045 ]:
SQLSTATE[28000] [1045] Access denied for user '**********'@'localhost' (using password: YES)

Upvotes: 0

Views: 226

Answers (1)

Master Bee
Master Bee

Reputation: 1099

Have a look at the bootstrap file (fuel/app/bootstrap.php):

Fuel::$env = (isset($_SERVER['FUEL_ENV']) ? $_SERVER['FUEL_ENV'] : Fuel::DEVELOPMENT);

You can create a server variable with the name "FUEL_ENV" and the value "production". Put something like this in your nginx vhost file:

location ~* \.php$ {
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_index index.php;
    fastcgi_split_path_info ^(.+\.php)(.*)$;
    include fastcgi_params;
    fastcgi_param FUEL_ENV production; # this one
}

Upvotes: 1

Related Questions