Welcome Guest, Not a member yet? Register   Sign In
SetEnv in .htaccess file doesn't seem to work with PHP-FPM
#1

I'm moving my CodeIgniter project to a new server, which has Apache in event mode with PHP-FPM installed. For some reason, the SetEnv directives in my .htaccess file no longer find their way into PHP:
Code:
SetEnv CI_ENV testing
that CI_ENV value doesn't ever find its way into $_SERVER["CI_ENV"] in php.

Can anyone tell me why this isn't working and what the recommended best practice is for setting this value a php-fpm environment?

This also may apply to CI controllers executed via command line.
Reply
#2

Make sure that mod_env.s or mod_env.so is enabled in your php.ini and Apache config.

Apache 2.4 needs it enabled. Otherwise it could be a configuration setting in PHP-FPM.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

(03-22-2018, 12:21 PM)InsiteFX Wrote: Make sure that mod_env.s or mod_env.so is enabled in your php.ini and Apache config.

Apache 2.4 needs it enabled. Otherwise it could be a configuration setting in PHP-FPM.

if i understnd you correctly, mod_env is installed as an apache module:
Code:
$ sudo apachectl -M | grep env
env_module (shared)
setenvif_module (shared)

Apparently other folks have this problem too:
https://forum.codeigniter.com/thread-68103.html
Reply




Theme © iAndrew 2016 - Forum software by © MyBB