Welcome Guest, Not a member yet? Register   Sign In
Why is my ENVIRONMENT constant, "development" if my codeigniter app is online?
#4

(01-16-2018, 01:46 PM)desbest Wrote: I just changed the line on index.php to read

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

I've had several cases in Apache shared hosting setups where mod_env was not enabled. The following takes care of those
by assuming that if $_SERVER['CI_ENV'] is not set (as it should have been in .htaccess) it's because we're on the live site.

PHP Code:
define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'production'); 
Reply


Messages In This Thread
RE: Why is my ENVIRONMENT constant, "development" if my codeigniter app is o... - by dave friend - 01-16-2018, 02:59 PM



Theme © iAndrew 2016 - Forum software by © MyBB