CMS Made Simple Core


[#11591] Phar installer doesn't work with OPCache enabled

Created By: Tristan (tristan)
Date Submitted: Tue Oct 03 04:46:39 -0400 2017

Assigned To: Fernando Morgado (JoMorg)
CMSMS Version:
Severity: Major
Resolution: Fixed
State: Open
Phar installer doesn't work with OPCache enabled
Detailed Description:
As described in this forum post:

You need to disable OPCache to have the Phar install working as advertised
otherwise it will just error 500 with these kind of errors in the log:

PHP Fatal error: Phar::webPhar(): Failed opening required
in /var/www/vhosts/ on line 8, referer:

if this isn't a bug but a feature, maybe we should add a note to the
documentation at Installation - Requirements to temporarily disable OPCache
before starting the Phar install?

Especially since elsewhere in the documentation at "Performance and Tuning
Information (recommended settings, but not required)"  it's suggested to make
sure there are NO values like php_flag opcache.enable Off in .htaccess and
having OPCache disables also throws a caution on the System Information page
while in the cases mentioned on the forum it's actually required to set php_flag
opcache.enable Off to make the Phar install work.


Date: 2017-10-04 09:28
Posted By: Robert Campbell (calguy1000)

Opcache works fine for me in the installer.  Tested many times
Either way this is not a CMSMS issue but a PHP or web-server issue.
Date: 2017-10-05 05:50
Posted By: Tristan (tristan)

How are you running PHP on these test instances? Over here it's mostly as
mod_php with mod_ruid2.
Date: 2017-10-17 09:04
Posted By: Robert Campbell (calguy1000)

This is not a CMSMS issue as in some environments the phar installer fails
before ever getting to the CMSMS code.
opcache and xcache and other plugins are known to be problematic in some 
combination of environments but I have had no difficulty with mod_php and
mod_cfgid with PHP 7
Date: 2020-09-30 05:57
Posted By: Morten Poulsen (silmarillion)

The installer still have an issue with opcache, at least on the 2 different
servers I tried. Putting
php_flag opcache.enable Off 
inside .htaccess solves it
Could this be put in a htaccess inside the phar-file? Or perhaps
ini_set('php_flag opcache.enable', Off);
Included in index.php or something?
Thank you!
Date: 2020-09-30 10:40
Posted By: Fernando Morgado (JoMorg)

Fixed in SVN for next release. Thanks!

Updated: 2020-09-30 10:40
resolution_id: 11 => 7
assigned_to_id: 100 => 12532

Updated: 2020-09-30 05:57
severity_id: 4 => 2

Updated: 2020-09-30 05:57
state: Closed => Open

Updated: 2017-10-17 09:04
state: Open => Closed

Updated: 2017-10-04 09:28
resolution_id: => 11