From: paul dot sanchez at basicdays dot com
Operating system: Windows 7
PHP version: 5.3.2RC1
PHP Bug Type: Directory function related
Bug description: file_exists works warns when not under server doc root
Description:
------------
- Using the VC9 x86 Non Thread Safe 5.3.1 version and the 5.3.2RC1 version
from windows.php.net
- IIS7 using fast cgi
- Script works when under C:\inetpub\wwwroot
- Script gives warning when it is running under a virtual directory or
application
- Problem does not exist when open_basedir is not set
- Following are some php.ini settings from development ini file
- cgi.force_redirect = 0
- cgi.fix_pathinfo = 1
- fastcgi.impersonate = 1
- fastcgi.logging = 0
Reproduce code:
---------------
<?php
$root = dirname(__FILE__);
echo $root;
echo 'phpinfo.php: ' . file_exists('test.php') . '<br>';
echo 'junk.php: ' . file_exists('junk.php') . '<br><br>';
echo 'phpinfo.php: ' . file_exists("$root/test.php") . '<br>';
echo 'junk.php: ' . file_exists("$root/junk.php") . '<br><br>';
?>
Expected result:
----------------
C:\Users\myname\WIP\myproject
test.php: 1
junk.php:
test.php: 1
junk.php:
Actual result:
--------------
C:\Users\myname\WIP\myproject
test.php: 1
Warning: file_exists() [function.file-exists.php]: open_basedir
restriction in effect. File(junk.php) is not within the allowed path(s):
(C:\inetpub\wwwroot;C:\Users\myname\WIP) in
C:\Users\myname\WIP\myproject\test.php on line 5
junk.php:
test.php: 1
Warning: file_exists() [function.file-exists.php]: open_basedir
restriction in effect. File(C:\Users\myname\WIP\myproject/junk.php) is not
within the allowed path(s): (C:\inetpub\wwwroot;C:\Users\myname\WIP) in
C:\Users\myname\WIP\myproject\test.php on line 8
junk.php:
--
Edit bug report at http://bugs.php.net/?id=50841&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=50841&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=50841&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=50841&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=50841&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=50841&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=50841&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=50841&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=50841&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=50841&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=50841&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=50841&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=50841&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=50841&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=50841&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50841&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=50841&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=50841&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=50841&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=50841&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=50841&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=50841&r=mysqlcfg