php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20360 On Apache2 file_exists & co are looking in wrong directory
Submitted: 2002-11-11 07:13 UTC Modified: 2002-11-11 07:19 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: michal at michal dot waw dot pl Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 4.2.3 OS: Linux
Private report: No CVE-ID: None
 [2002-11-11 07:13 UTC] michal at michal dot waw dot pl
PHP functions which map to access() libc function are looking in wrong directory under Apache2. Simple example:
$FILE = "test.php";
file_exists($FILE);
is_readable($FILE);
fopen($FILE, "r");

produces such output from strace:
access("test.php", F_OK)                = -1 ENOENT (No such file or directory)
access("test.php", R_OK)                = -1 ENOENT (No such file or directory)
open("/home/httpd/html.michal.waw.pl", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 22

Also note that:
[root@woland html.michal.waw.pl]# l /proc/16627/cwd
lrwxrwxrwx    1 root     root            0 11-11 13:57 /proc/16627/cwd -> /
[root@woland html.michal.waw.pl]#
where 16627 is a PID of httpd process which was traced earlier.

Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-11 07:19 UTC] edink@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Aug 14 14:01:29 2024 UTC