From:             troels at kyberfabrikken dot dk
Operating system: red hat linux
PHP version:      4.3.4
PHP Bug Type:     Documentation problem
Bug description:  wrong error message generated by opendir when safe mode is in effect

Description:
------------
while trying to open a dir that diddent exist, i recieved a wrong
error-message. this caused me to waste a lot of time, before i finally
figured out the real problem.



1. php is running as module under apache in safe mode. version = 4.3.3

2. /home/virtual/site1/fst/var/www/html/ is my www root

3. /home/virtual/site1/fst/var/www/html/data/ is a dir, end it's CHMOD
777

4. /home/virtual/site1/fst/var/www/html/data/subdir is non-existent



i recieve this error message :



Warning in line 3 of file /home/virtual/site1/fst/var/www/html/index.php

[2] opendir(): SAFE MODE Restriction in effect. The script whose uid is
503 is not allowed to access
/home/virtual/site1/fst/var/www/html/data/subdir owned by uid 0 



witch gave my a few hours messing around until i finally discovered that i
just forgot to create the dir in mention.

however - if php had given me a more precise error, i would have saved a
lot of time. when it comes down to it, safemode had nothing to do with the
real problem.

Reproduce code:
---------------
[index.php : begin]

<?php

$dir = "/home/virtual/site1/fst/var/www/html/data/subdir";

$handle = opendir($dir);

?>

[index.php : end]


-- 
Edit bug report at http://bugs.php.net/?id=27498&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=27498&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=27498&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=27498&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=27498&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=27498&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=27498&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=27498&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=27498&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=27498&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=27498&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=27498&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=27498&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27498&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=27498&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=27498&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=27498&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27498&r=float

Reply via email to