CMS MADE SIMPLE FORGE

CMS Made Simple Core

 

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

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

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

https://forum.cmsmadesimple.org/viewtopic.php?f=3&t=76869&p=334131&hilit=PHP+Fatal+error%3A+Phar%3A%3AwebPhar+%3A+Failed+opening+required#p334131

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
'phar:///var/www/vhosts/somedomain.com/cmsms-2.2.1-install.php/index.php'
(include_path='phar:///var/www/vhosts/somedomain.com/cmsms-2.2.1-install.php:.')
in /var/www/vhosts/somedomain.com/cmsms-2.2.1-install.php on line 8, referer:
https://somedomain.com/cmsms-2.2.1-install.php/index.php

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.


History

Comments
avatar
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.
      
avatar
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.
      
avatar
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
      
avatar
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!
      
avatar
Date: 2020-09-30 10:40
Posted By: Fernando Morgado (JoMorg)

Fixed in SVN for next release. Thanks!
      
avatar
Date: 2020-11-03 14:26
Posted By: Rolf (rolf1)

CMSMS 2.2.15 has been released
      
Updates

Updated: 2020-11-03 14:26
state: Open => Closed

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