Bug #69658 [NEW]: session.save_path PHP_ADMIN_VALUE fastcgi_param Mode Not Parsed Correctly
| From: | own3mall at gmail dot com | Date: | Tue, 19 May 2015 04:10:22 +0000 |
| Subject: | Bug #69658 [NEW]: session.save_path PHP_ADMIN_VALUE fastcgi_param Mode Not Parsed Correctly | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-192744@lists.php.net to get a copy of this message | ||
From: own3mall at gmail dot com
Operating system: Ubutun 15.04
PHP version: 5.6.9
Package: FPM related
Bug Type: Bug
Bug description:session.save_path PHP_ADMIN_VALUE fastcgi_param Mode Not Parsed Correctly
Description:
------------
If I setup a server entry in nginx which has the following section
# pass the PHP scripts to FastCGI server listening on
127.0.0.1:9000
#
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME
/var/www/new$fastcgi_script_name;
fastcgi_param PHP_ADMIN_VALUE
"open_basedir=/var/www/new/:/tmp:/usr/share/php:/usr/share/pear:/usr/share/roundcube
\n upload_tmp_dir=/tmp \n
session.save_path=0;660;/var/www/php_sessions";
include fastcgi_params;
}
session.save_path is not parsed correctly. When using
session_save_path(), the path is set to "0". For some reason, in nginx
configuration files, the MODE set in PHP_ADMIN_VALUE for
session.save_path is not processed correctly. I would expect
session_save_path() to return "/var/www/php_sessions" as it does in
Apache when using this:
php_admin_value session.save_path 0;660;/var/www/php_sessions
It should not return "0" as the path. It took me days to figure out why
this wasn't working in nginx when it was working in apache.
Similar to bug #52609. Problem is still occurring in php5-fpm package
from Ubuntu 15.04. Actual true version is:
PHP 5.6.4-4ubuntu6 (fpm-fcgi) (built: Apr 17 2015 15:47:47)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend
Technologies
Test script:
---------------
Setup and install nginx and php5-fpm. In
/etc/nginx/sites-enabled/default, add this:
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME
/var/www/new$fastcgi_script_name;
fastcgi_param PHP_ADMIN_VALUE
"open_basedir=/var/www/new/:/tmp:/usr/share/php:/usr/share/pear:/usr/share/roundcube
\n upload_tmp_dir=/tmp \n
session.save_path=0;660;/var/www/php_sessions";
include fastcgi_params;
}
Put a php file in the root with the following:
<?php
session_start();
echo "My session path is: " . session_save_path();
?>
Expected result:
----------------
When specified with a preceding MODE, the file permissions mode should
be respected, and the session.save_path should return as defined
"/var/www/php_sessions" rather than "0"
Actual result:
--------------
session.save_path is "0".
--
Edit bug report at https://bugs.php.net/bug.php?id=69658&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69658&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69658&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69658&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=69658&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=69658&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=69658&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=69658&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=69658&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=69658&r=support
Expected behavior: https://bugs.php.net/fix.php?id=69658&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=69658&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=69658&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=69658&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69658&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=69658&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=69658&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=69658&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69658&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=69658&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=69658&r=mysqlcfg