zendtech / ZendOptimizerPlus

Other
914 stars 142 forks source link

2 different files required w/ same relative path resolve to one file #227

Open rob-odil opened 7 years ago

rob-odil commented 7 years ago

We have multiple ZF2 applications running on the same server. The ./public/index.php does a require of "config/application.config.php".

Zend\Mvc\Application::init(require 'config/application.config.php')->run();

Once that file is cached for one of the applications, the other applications all hit the same file in the opcode cache. Changing the require a full path using getcwd fixes this issue.

Zend\Mvc\Application::init(require getcwd() . '/config/application.config.php')->run();

dstogov commented 7 years ago

opcache.use_cwd=1 in php.ini should solve the issue (1 is the default value).

opcache.revalidate_path=1 may help, if the problem caused by changes in symlinks.