I tried to modify php.ini in the following way:
variables_order = "GPCSE"
register_globals = On
But the required PATH
variable is neither in $_ENV
nor accessible via getenv('PATH')
.
I'm running Nginx + PHP-FPM on Ubuntu 10.04.
Note: executing the following command in console gives a correct result:
php -r "echo getenv('PATH');"
I guess that PATH
is environment variable of bash, but as long as php-fpm not starting via bash it doesn't have required variables. Any way to include them?
Thanks.
Update#1: As temporary solution I found out that PATH variable stored in '/etc/environment' file. So I just going to read it from there. If someone needs a code:
preg_match('/^(PATH)="?([^"]+)"?$/i', file_get_contents('/etc/environment'), $match);
putenv($match[1]."=".$match[2]);
register_globals
?