Edit report at http://bugs.php.net/bug.php?id=50709&edit=1
ID: 50709 Updated by: fel...@php.net Reported by: framelio at gmail dot com Summary: file_exists() triggers a warning when path contains file as dir and open_basedir -Status: Open +Status: Feedback Type: Bug Package: Safe Mode/open_basedir Operating System: Linux PHP Version: 5.3.1 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-09 18:03:57] framelio at gmail dot com Description: ------------ I have PHP 5.3.1 installed ad apache module with apache version Apache/2.2.14. I configured a virtual host with the directive: php_admin_value open_basedir "/usr/share/pear:/home:/var/www/hosts:/tmp" The script is into the path: /home/user/web/test.php and there is a symbolik link from "/var/www/hosts/domain.tld" to "/home/user/web" When I try to execute a file_exists on a path like this: /var/www/hosts/domain.tld/test.php/testfile.file Where "test.php" is a FILE and not a DIRECTORY On all the other cases, no errors. The special condition is the symbolink link and the filename in the path (like it's a directory). Reproduce code: --------------- var_dump(file_exists("/var/www/hosts/domain.tld/test.php/testfile.file")); // Where "test.php" is a FILE and not a DIRECTORY, and domain.tld is a symbolink link to another directory. Expected result: ---------------- bool(false) Actual result: -------------- Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/var/www/hosts/domain.tld/test.php/testfile.file) is not within the allowed path(s): (/usr/share/pear:/home:/var/www/hosts:/tmp) in /home/user/web/test.php on line 1 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=50709&edit=1