Имейте в виду, что доступность $_ENV
переменных зависит от значения variables_order
в php.ini, используемом php-fpm.По умолчанию EGPCS
, где E
- среда, однако в Ubuntu 12.04 я обнаружил, что это GPCS
.Сам php.ini содержит предупреждение о $_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.
. Рекомендуется использовать getenv()
, который всегда доступен.Я обнаружил, что переменные, которые я установил в пуле FPM, могут быть получены таким образом.