|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-05-19 10:31 UTC] yohgaki@php.net
-Status: Open
+Status: Feedback
[2015-05-19 10:31 UTC] yohgaki@php.net
[2015-05-20 03:53 UTC] own3mall at gmail dot com
[2015-05-31 04:22 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 08:00:01 2025 UTC |
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".