From: Danack at basereality dot com
Operating system: Centos
PHP version: 5.5.13
Package: opcache
Bug Type: Bug
Bug description:Opcache
Description:
------------
When the config 'opcache.validate_timestamps' is set to 0 opcache
incorrectly resolves relative filenames.
If you include a file with require "../src/bootstrap.php"; from two
completely different directories then OPcache will serve the same file
even though realpath("../src/bootstrap.php"); resolves to completely
different directories.
This does not happen when opcache.validate_timestamps is set to a
non-zero value.
It can also be worked around by using `require __DIR__ .
'/../src/bootstrap.php';`
Test script:
---------------
File /home/project1/web/index.php
=================================
<?php
require "../src/bootstrap.php";
?>
File /home/project2/web/index.php
=================================
<?php
require "../src/bootstrap.php";
?>
File /home/project2/src/bootstrap.php
=====================================
<?php
echo "I am project2's bootstrap file.";
If you go to a webpage served by project1 first, then go to a webpage
served by project2, project2 will get be given project1's bootstrap
file.
--
Edit bug report at https://bugs.php.net/bug.php?id=67481&edit=1
--