It seems there is problem with loading Phar files when using zend opcache, i trace it down to path issues.
for example when you use the following script in Mutliple Hosts Environment (MHE), it does not work and the autoload does not find and scripts, and my guess is that the opcache is loading the other websites phar and they have different owner & permmsions so its fails to load them.
<?php
$baseDir = './';
include("phar://{$baseDir}include/twig.phar/Twig/Autoloader.php");
Twig_Autoloader::register();
$loader = new Twig_Loader_Filesystem($baseDir . '/tpl/');
?>
but changing the baseDir to
<?php
$baseDir = '/home/user/public_html/';
include("phar://{$baseDir}include/twig.phar/Twig/Autoloader.php");
$loader = new Twig_Loader_Filesystem($baseDir . '/tpl/');
?>
it seems to work alright, and Yes i tried the first script with opcache disabled and it worked
the same problem happens with APC as well.
It seems there is problem with loading Phar files when using zend opcache, i trace it down to path issues.
for example when you use the following script in Mutliple Hosts Environment (MHE), it does not work and the autoload does not find and scripts, and my guess is that the opcache is loading the other websites phar and they have different owner & permmsions so its fails to load them.
but changing the baseDir to
it seems to work alright, and Yes i tried the first script with opcache disabled and it worked
the same problem happens with APC as well.