|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-04-19 01:56 UTC] fat@php.net
Description: ------------ It would be cool to be able to define ini settings directly in the web server (nginx, lighthttpd, apache) the same way it's possible for the apache sapi (php_value, php_admin_value, ...) Test script: --------------- no test Expected result: ---------------- nginx conf sample: fastcgi_param PHP_VALUE sessions.save_path=/home/www/sessions/ fastcgi_param PHP_ADMIN_VALUE open_basedir=/home/www/docs Actual result: -------------- it doesn not exist PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 00:00:02 2025 UTC |
I, too, have noticed that PHP configuration directives that are defined like this, within an nginx "location{}" block fastcgi_param PHP_VALUE " error_reporting=6143 log_errors=On "; are not effective. The values are propagated to the effective environment variables, though, as evidenced by the fact that the values appear in the $_SERVER["PHP_VALUE"] superglobal. Will this ever work? Or is it simply not possible to achieve this with PHP's CGI executable (instead of, for example, php-fpm)?It is possible to pass variables in lighttpd 1.4: setenv.add-environment += ( "PHP_VALUE" => " user_agent=\"ff\" user_ini.filename=\".php.user.ini\" memory_limit=\"500M\" " ) you need to use raw newlines to separate values and of course escape quotes for lighttpd config parseractually, no quotes are neccessary, and single quotes work too: setenv.add-environment += ( "PHP_VALUE" => " user_agent=ff2 dd user_ini.filename='.php.user.ini' memory_limit=501M " ) parse as: param[user_agent]: string(6) "ff2 dd" param[user_ini.filename]: string(14) ".php.user2.ini" param[memory_limit]: string(4) "501M"