php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42150 session_start() fails when safe_moce = On
Submitted: 2007-07-30 22:16 UTC Modified: 2007-07-31 11:59 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: jonas at chown dot dk Assigned:
Status: Not a bug Package: Safe Mode/open_basedir
PHP Version: 5.2.3 OS: Linux - Gentoo
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jonas at chown dot dk
New email:
PHP Version: OS:

 

 [2007-07-30 22:16 UTC] jonas at chown dot dk
Description:
------------
Running Gentoo Linux with apache-2.0.58-r2 and php-5.2.3-r3. After the upgrade to php 5.2.3-r3 from 5.2.2-r1 some of my pages that uses sessions no longer works. If I use safe_mode = On (only change made to php.ini) and do a session_start() I get a message that SAFE MODE Restriction in effect. This used to work on PHP 5.2.2. If I downgrade to php 5.2.2 it works again, so it is the php upgrade that triggers this error. Permissions on /tmp is as they should be on a tmp dir. I have not been able to find anything in the change log that mentions this change of behavior.   

drwxrwxrwt  42 root  root    12288 2007-07-30 23:56 tmp


Reproduce code:
---------------
<?
session_start();

$_SESSION['test'] = "hejsa";

for($i = 0; $i < 10; $i++) {
        echo $i . '<br/>';
}
?>


Expected result:
----------------
0
1
2
3
4
5
6
7
8
9

Actual result:
--------------
Warning: session_start() [function.session-start]: SAFE MODE Restriction in effect. The script whose uid is 81 is not allowed to access /tmp owned by uid 0 in /var/www/localhost/htdocs/test.php on line 2

Fatal error: session_start() [<a href='function.session-start'>function.session-start</a>]: Failed to initialize storage module: files (path: ) in /var/www/localhost/htdocs/test.php on line 2

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-07-31 11:55 UTC] jani@php.net
The change is actually supposed to be in PHP 5.2.3 but I guess Gentoo people decided they can release 5.2.3 with extra patches.

See also bug #42077

This is not the place to report bugs in Gentoo packages.
Try http://bugs.gentoo.org/ instead.



 [2007-07-31 11:59 UTC] jani@php.net
I meant of course that the fix was due to be in 5.2.4 but it's being reviewed still.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 14:01:36 2025 UTC