ID:               50841
 Updated by:       [email protected]
-Summary:          file_exists works warns when not under server doc root
 Reported By:      paul dot sanchez at basicdays dot com
-Status:           Open
+Status:           Feedback
-Bug Type:         Directory function related
+Bug Type:         Safe Mode/open_basedir
-Operating System: Windows 7
+Operating System: win32 only - Windows 7
 PHP Version:      5.3.2RC1
 New Comment:

Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/




Previous Comments:
------------------------------------------------------------------------

[2010-01-26 07:07:00] paul dot sanchez at basicdays dot com

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 this bug report at http://bugs.php.net/?id=50841&edit=1

Reply via email to