Remember that the availability of $_ENV variables depends on the variables_order setting in php.ini used by php-fpm. By default, EGPCS used, where E is the environment, however on Ubuntu 12.04 I found that it was GPCS . $_ENV itself carries a warning about $_ENV :
; This directive determines which super global arrays are registered when PHP ; starts up. G,P,C,E & S are abbreviations for the following respective super ; globals: GET, POST, COOKIE, ENV and SERVER. There is a performance penalty ; paid for the registration of these arrays and because ENV is not as commonly ; used as the others, ENV is not recommended on productions servers.
It is recommended that you use getenv() , which is always available. I found that the variables set in the FPM pool can be restored in this way.
shrikeh
source share