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

Why is my ENVIRONMENT constant, "development" if my codeigniter app is online, not on localhost?
What is going on? How do I fix it?
Reply
#2

(This post was last modified: 01-16-2018, 01:39 PM by Elias.)

Look at index.php file in your webroot directory. Env variable passing from webserver (apatche, nginx etc). Or you can define it manual...

also you may visit this page https://www.codeigniter.com/user_guide/g...ments.html
Reply
#3

I just changed the line on index.php to read


PHP Code:
define('ENVIRONMENT', isset($_SERVER['ENVIRONMENT']) ? $_SERVER['ENVIRONMENT'] : 'development'); 
Reply
#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




Theme © iAndrew 2016 - Forum software by © MyBB