Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
SetEnv not working
  • Hi,

    I deployed an app to AppFog. on their Env Variables, I placed "FUEL_ENV" => production. 

    getenv() is properly detecting it. However, it looks like FuelPHP still isn't running as production. 

    The config on production/db.php is not detected, however, development/db.php is. I noticed that when I placed SetEnv FUEL_ENV production on .htaccess, it works. (But of course, that's not how we're supposed to deploy it to the cloud).

    Is this a bug? Or I'm missing something?

    Thanks.
  • HarroHarro
    Accepted Answer
    Fuel uses

    $_SERVER['FUEL_ENV']

    which is used in app/bootstrap.php to get the environment. So I think AppFog does something special, so that $_SERVER isn't populated correctly.

    Best option is to just change the app bootstrap
  • There! Thanks. 

    (I changed bootstrap.php and used getenv() instead.)

Howdy, Stranger!

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

In this Discussion