Bug #36555 [Com]: realpath_cache never updated with symlinks (removed or renamed)
| From: | spam2 at rhsoft dot net | Date: | Sat, 07 Jan 2017 18:42:39 +0000 |
| Subject: | Bug #36555 [Com]: realpath_cache never updated with symlinks (removed or renamed) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-206357@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=36555&edit=1
ID: 36555
Comment by: spam2 at rhsoft dot net
Reported by: p at damezin dot com
Summary: realpath_cache never updated with symlinks (removed
or renamed)
Status: Not a bug
Type: Bug
Package: Filesystem function related
Operating System: Linux OpenBSD
PHP Version: 5.2.0
Block user comment: N
Private report: N
New Comment:
the problem with "clearstatcache" is that each php-worker maintains it's own
'realpath_cache' and so your request touching the file may correctly reset it, but every
request hit another php-process until TTL is reached will continue to work with the still existing
stale data
https://bugs.php.net/bug.php?id=73888
Previous Comments:
------------------------------------------------------------------------
[2014-06-26 19:37:48] alexandru dot ort at gmail dot com
Same bug on ubuntu 12.04 lts with php 5.3.10.
------------------------------------------------------------------------
[2013-01-10 16:56:47] v dot rutkunas at pccsuk dot com
XAMPP - Apache 2.4, PHP 5.4.7 here, bug still exists...
------------------------------------------------------------------------
[2012-09-09 01:20:08] webmaster at wininup dot com
Sorry, the last workaround with fopen() is not working better. Same bug.
------------------------------------------------------------------------
[2012-09-09 01:06:58] webmaster at wininup dot com
Well this basic workaround is to replace file_get_contents($symlink) with :
$fh = fopen($symlink, 'r');
$raw = fread($fh, filesize($symlink));
fclose($symlink);
------------------------------------------------------------------------
[2012-09-08 16:04:14] webmaster at wininup dot com
Same problem for this user : http://sixohthree.com/1517/php-and-the-realpath-
cache
He seems right telling that the cache is not thread safe.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=36555
--
Edit this bug report at https://bugs.php.net/bug.php?id=36555&edit=1