ID: 50567 User updated by: svecpetr at svecpetr dot com Reported By: svecpetr at svecpetr dot com -Status: Feedback +Status: Open Bug Type: Safe Mode/open_basedir Operating System: freebsd PHP Version: 5.2SVN-2009-12-24 (snap) New Comment:
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 Previous Comments: ------------------------------------------------------------------------ [2009-12-24 23:22:54] j...@php.net 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