php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74268 Opcache fails to detect directory symlink changes
Submitted: 2017-03-17 21:07 UTC Modified: -
Votes:5
Avg. Score:4.0 ± 0.6
Reproduced:5 of 5 (100.0%)
Same Version:2 (40.0%)
Same OS:3 (60.0%)
From: marshall at ahoy dot com Assigned:
Status: Open Package: opcache
PHP Version: 7.1.3 OS: Linux Ubuntu 16.04.2 LTS
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: marshall at ahoy dot com
New email:
PHP Version: OS:

 

 [2017-03-17 21:07 UTC] marshall at ahoy dot com
Description:
------------
When a directory symlink is changed to a new target directory and the new target contains file names that were also in the old target directory, OPcache sometimes returns the old file instead of the new file.

lrwxrwxrwx 1 root root     2 Mar 17 20:28 v -> v1
-rw-r--r-- 1 root root    60 Mar 17 20:22 test.php
drwxr-xr-x 2 root root  4096 Mar 17 20:22 v2
drwxr-xr-x 2 root root  4096 Mar 17 20:21 v1

Both v1 and v2 contain home.php with different contents

Changing the symlink v from v1 to v2 does not always cause the desired result.  Sometimes OPcache alternates between the two different home.php pages.

Using FPM/FastCGI with PHP Version 7.1.3-2+deb.sury.org~xenial+1
Same problem using PHP Version 7.0.15

Test script:
---------------
test.php:
<?php
echo "This is test.php\n";
include("v/home.php");
?>

v1/home.php:
<?php
echo "This is v1/home.php\n";

v2/home.php:
<?php
echo "This is v2/home.php\n";



Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Jul 31 02:01:23 2021 UTC