From:             jonas at chown dot dk
Operating system: Linux - Gentoo
PHP version:      5.2.3
PHP Bug Type:     Safe Mode/open_basedir
Bug description:  session_start() fails when safe_moce = On

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

-- 
Edit bug report at http://bugs.php.net/?id=42150&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42150&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42150&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42150&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=42150&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=42150&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=42150&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=42150&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=42150&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=42150&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=42150&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=42150&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=42150&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=42150&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42150&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=42150&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=42150&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=42150&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42150&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=42150&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=42150&r=mysqlcfg

Reply via email to