|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-12-24 09:36 UTC] 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 15:00:02 2025 UTC |
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