Bug #69136 [Com]: Session file empty when session-path on NFS mount
| From: | maggus dot staab at googlemail dot com | Date: | Fri, 27 Feb 2015 10:59:29 +0000 |
| Subject: | Bug #69136 [Com]: Session file empty when session-path on NFS mount | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-190986@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=69136&edit=1
ID: 69136
Comment by: maggus dot staab at googlemail dot com
Reported by: maggus dot staab at googlemail dot com
Summary: Session file empty when session-path on NFS mount
Status: Open
Type: Bug
Package: Session related
Operating System: Ubuntu 14 LTS
PHP Version: 5.6.6
Block user comment: N
Private report: N
New Comment:
1) I dont understand why the session cannot be written, since I checked is_dir, is_writable and
is_readable beforehand. Even setting the dir to "0777" makes it work.
2) when basic things like writing a session doesnt work, I would expect a ERROR instead of a WARNING
Previous Comments:
------------------------------------------------------------------------
[2015-02-27 10:56:47] maggus dot staab at googlemail dot com
Description:
------------
php -v
PHP 5.6.5-1+deb.sury.org~trusty+1
Test script:
---------------
<?php
$path = '/path/to/a/dir/mounted/via/nfs/';
if (!is_dir($path) || !is_writable($path) || !is_readable($path)) {
throw new Exception("$path is not a proper dir");
}
//ini_set("session.save_path", $path); // neither this works
session_save_path($path); // nor this does
session_start();
$_SESSION['cnt'] = $_SESSION['cnt']+1;
var_dump($_SESSION['cnt']);
if ($_SESSION['cnt'] > 1) {
echo "<h1>WORKS</h1>";
session_destroy();
}
exit();
Expected result:
----------------
on each 2nd request "WORKS" is printed.
Actual result:
--------------
session is not persisted. session file gets created but does not contain any content. therefore
subsequent calls will never echo "WORKS" because session cannot be continued.
with default Ubuntu php.ini a error/warning doesnt show up at all.
After adding
ini_set("display_errors", "On");
error_reporting(E_ALL);
I get a warning
"Warning: Unknown: Failed to write session data (files). Please verify that the current setting
of session.save_path is correct (/XX..ZZ..YY/tmp/www/session/) in Unknown on line 0"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=69136&edit=1