Bug #69136 [NEW]: Session file empty when session-path on NFS mount
| From: | maggus dot staab at googlemail dot com | Date: | Fri, 27 Feb 2015 10:56:48 +0000 |
| Subject: | Bug #69136 [NEW]: Session file empty when session-path on NFS mount | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-190985@lists.php.net to get a copy of this message | ||
From: maggus dot staab at googlemail dot com
Operating system: Ubuntu 14 LTS
PHP version: 5.6.6
Package: Session related
Bug Type: Bug
Bug description:Session file empty when session-path on NFS mount
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 bug report at https://bugs.php.net/bug.php?id=69136&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69136&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69136&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69136&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=69136&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=69136&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=69136&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=69136&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=69136&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=69136&r=support
Expected behavior: https://bugs.php.net/fix.php?id=69136&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=69136&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=69136&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=69136&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69136&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=69136&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=69136&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=69136&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69136&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=69136&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=69136&r=mysqlcfg