CodeIgniter3: Why would $_SERVER['CI_ENV'] ever be set in the first place?

Viewed 19701

I see that in their default installation, their index.php has this:

define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development');

Why would CI_ENV ever already be set within the $_SERVER array?

3 Answers

Just in case you are using nginx, here is the configuration you have to add inside vhosts configuration:

  server {

        location ~ \.php$ {
            fastcgi_param CI_ENV production;
        }

save and run nginx syntax check (just to avoid you from cursing me):

nginx -t

if you having issues or you cant find the parameter, you can follow the answer below: Nginx variables similar to SetEnv in Apache?

Related