php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54309 Multiple environment variables for PHP_ADMIN_VALUE only accepts last value
Submitted: 2011-03-18 17:31 UTC Modified: 2011-07-02 12:55 UTC
From: michael at kazenonline dot com Assigned: fat (profile)
Status: Not a bug Package: FPM related
PHP Version: 5.3.6 OS: Linux
Private report: No CVE-ID: None
 [2011-03-18 17:31 UTC] michael at kazenonline dot com
Description:
------------
If you wanted to specify multiple PHP_ADMIN_VALUE environment variables, such as 
(nginx config):

fastcgi_param PHP_ADMIN_VALUE "sendmail_from=Me";
fastcgi_param PHP_ADMIN_VALUE "sendmail_path=/usr/sbin/sendmail -f me@me.com";

then only the second one gets picked up (probably because as an environment 
variable, the last one is clobbering over the first one(s)).



Expected result:
----------------
Respect multiple PHP_ADMIN_VALUE variables, or perhaps read in environment 
variables like PHP_ADMIN_VALUE[variable_name], so that this would work:

fastcgi_param PHP_ADMIN_VALUE[sendmail_from] "me";
fastcgi_param PHP_ADMIN_VALUE[sendmail_path] "/usr/sbin/sendmail -f me@me.com";



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-07-02 12:50 UTC] fat@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: fat
 [2011-07-02 12:50 UTC] fat@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 [2011-07-02 12:55 UTC] fat@php.net
-Status: Assigned +Status: Bogus
 [2011-07-02 12:55 UTC] fat@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

This is not a problem related to PHP. In fact this is due to the fastcgi 
protocol specification: only one parameter with the same name is allowed. If you 
try to set more than one parameter with the same name, the behaviour depends on 
the fastcgi client implementation (nginx only sends the last one)

The solution is to merge everything into one header separating with \n. 

fastcgi_param PHP_ADMIN_VALUE 
"sendmail_from=Me\nsendmail_path=/usr/sbin/sendmail -f me@me.com";


You can find additional informations here: https://bugs.php.net/bug.php?id=51595
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC