Cant set CI_ENVIRONMENT |
I am trying to set my environment dynamically on .htaccess file, but I cant.
This is my `.htaccess` file: Code: # Disable directory browsing But the problem is that the variable `$_SERVER['CI_ENVIRONMENT']` seems to to be rewritten to `$_SERVER['REDIRECT_CI_ENVIRONMENT']` Why is that? I know I can fix it on the index.php file with something like: PHP Code: $_SERVER['CI_ENVIRONMENT'] = $_SERVER['REDIRECT_CI_ENVIRONMENT']; But it doesn't feel good. Anybody knows a better solution?
In order for $_ENV to work, you need to reconfigure variables_order = "GPCSE" in your php.ini.
By default, it does not include E for $_ENV, it was originally variables_order = "GPCS" So check your php.ini file and make sure it is set correctly. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(06-07-2020, 12:39 PM)InsiteFX Wrote: In order for $_ENV to work, you need to reconfigure variables_order = "GPCSE" in your php.ini Thank you very much. I already added the `E`. The problem is that the variable is being generate like: $_ENV['REDIRECT_CI_ENVIRONMENT']; Instead of $_ENV['CI_ENVIRONMENT']; Note the unexpected "REDIRECT_" prefix.
(06-07-2020, 06:10 PM)thingNumber1 Wrote:(06-07-2020, 06:05 PM)John_Betong Wrote: I prefer setting the .htaccess generated $_SERVER variable in index.php. Code: <?php // index.php |
Welcome Guest, Not a member yet? Register Sign In |