Req #51595 [Com]: passing ini settings via FASTCGI parameters
| From: | ben at indietorrent dot org | Date: | Tue, 23 Jul 2013 17:57:37 +0000 |
| Subject: | Req #51595 [Com]: passing ini settings via FASTCGI parameters | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-180443@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=51595&edit=1
ID: 51595
Comment by: ben at indietorrent dot org
Reported by: fat@php.net
Summary: passing ini settings via FASTCGI parameters
Status: Closed
Type: Feature/Change Request
Package: FPM related
Operating System: any
PHP Version: trunk
Assigned To: fat
Block user comment: N
Private report: N
New Comment:
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)?
Previous Comments:
------------------------------------------------------------------------
[2011-10-24 14:06:56] info at breakdev dot com
it doesn't work with nginx anf php5-cgi spawn:
nginx version: nginx/0.7.67
PHP 5.3.8-1~dotdeb.1 with Suhosin-Patch (cli) (built: Aug 26 2011 12:46:54)
I used this line in the nginx.conf:
fastcgi_param PHP_ADMIN_VALUE open_basedir=/home/www/docs
so there was set
$_SERVER['PHP_ADMIN_VALUE']="open_basedir=/home/www/docs"
------------------------------------------------------------------------
[2011-08-21 18:06:17] fat@php.net
Yes it's been integrated into FPM since 5.3.3 I think. In all the cases, it works
with php 5.3.7
------------------------------------------------------------------------
[2011-08-21 17:40:43] ywarnier at beeznest dot org
Hi guys, has this been sent to any stable release of PHP? I can't find it in any part of http://www.php.net/ChangeLog-5.php#5.3.7
------------------------------------------------------------------------
[2010-04-23 19:15:58] fat@php.net
This bug has been fixed in SVN.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
It's been commited in revision 298383
In fastcgi headers, only unique values can be passed. So you have to concatenate
differentes value in one and
separate them with a new line character (\n).
For exemple in nginx, it could be done this way:
set $php_value "pcre.backtrack_limit=424242";
set $php_value "$php_value \n pcre.recursion_limit=99999";
fastcgi_param PHP_VALUE $php_value;
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/var/www/htdocs";
In lighttpd, it seems there is no options to pass custom headers :/
------------------------------------------------------------------------
[2010-04-23 18:06:04] fat@php.net
Automatic comment from SVN on behalf of fat
Revision: http://svn.php.net/viewvc/?view=revision&revision=298383
Log: Add PHP_VALUE and PHP_ADMIN_VALUE interpretation from fastcgi headers.
It works as php_value and php_admin_value from the main conf file or apache sapi.
See bug (request) #51595
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=51595
--
Edit this bug report at https://bugs.php.net/bug.php?id=51595&edit=1