Bug #50567 [NoF->Fbk]: cron execution with safe-mode fails on file_exists
| From: | felipe@php.net | Date: | Sun, 25 Apr 2010 18:39:35 +0000 |
| Subject: | Bug #50567 [NoF->Fbk]: cron execution with safe-mode fails on file_exists | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-149894@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=50567&edit=1
ID: 50567
Updated by: felipe@php.net
Reported by: svecpetr at svecpetr dot com
Summary: cron execution with safe-mode fails on file_exists
-Status: No Feedback
+Status: Feedback
Type: Bug
Package: Safe Mode/open_basedir
Operating System: freebsd
PHP Version: 5.2SVN-2009-12-24 (snap)
New Comment:
Please try using this snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
Previous Comments:
------------------------------------------------------------------------
[2010-01-06 01:00:01] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2009-12-25 16:30:08] rasmus@php.net
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.
------------------------------------------------------------------------
[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] jani@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/bug.php?id=50567&edit=1