Skip to content

path issue when using phar #115

@arabcoders

Description

@arabcoders

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions