ID: 50567
Updated by: [email protected]
Reported By: svecpetr at svecpetr dot com
Status: Open
Bug Type: Safe Mode/open_basedir
Operating System: freebsd
PHP Version: 5.2SVN-2009-12-24 (snap)
New Comment:
Any symlinks involved anywhere along that path?
And yes, as Jani asked for, your relevant php.ini settings and a
reproducing script would help us determine what is going on here.
open_basedir works fine, so there is something you are not telling us.
Previous Comments:
------------------------------------------------------------------------
[2009-12-25 15:12:49] svecpetr at svecpetr dot com
just read :o)
open_base dir is: /DISK2/WWW:/DISK3/WWW:/DISK2/TMP:/NET:/tmp
error message is: Warning: file_exists(): open_basedir restriction in
effect.
File('/DISK2/WWW/xxx.cz/www/index.php') is not within the allowed
path(s):
(/DISK2/WWW:/DISK3/WWW:/DISK2/TMP:/NET:/tmp) in
/DISK2/WWW/xxx.cz/www/index.php on line 7
------------------------------------------------------------------------
[2009-12-24 23:22:54] [email protected]
What is the exact error you get with exactly what line of code? And
what is open_basedir set to? (EXACTLY..)
------------------------------------------------------------------------
[2009-12-24 09:36:30] svecpetr at svecpetr dot com
Description:
------------
read how reproduce this bug FIRST!!!
try execute file_exists($_SERVER['SCRIPT_FILENAME']);
$_SERVER['SCRIPT_FILENAME'] is '/DISK2/WWW/xxx.cz/www/index.php'
it fails with error:
Warning: file_exists(): open_basedir restriction in effect.
File(underconstruction.html) is not within the allowed path(s):
(/DISK2/WWW:/DISK3/WWW:/DISK2/TMP:/NET:/tmp) in
/DISK2/WWW/xxx.cz/www/index.php on line 7
Reproduce code:
---------------
---
>From manual page: function.file-exists#Description
---
safe-mode ON
execute script by CRON, means $_SERVER['REMOTE_ADDR'] is empty
get of getcwd() returns '/'
Expected result:
----------------
why should I change
chdir('/DISK2/WWW/xxx.cz/www/')
before use of function
file_exists($_SERVER['SCRIPT_FILENAME']);
or
file_exists('/DISK2/WWW/xxx.cz/www/index.php')
when I ask this function for file that is IN ALLOWED PATH
Actual result:
--------------
correct file_exists function
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50567&edit=1