OPCACHE causing problems with 2.6 upgrade

OPCACHE causing problems with 2.6 upgrade

by Shane Drower-Copley -
Number of replies: 5

Hi all,

I am running this version of my Moodle site on a localhost LAMP setup. Ubuntu 12.04, Apache 2.2.22, MySQL 4.3.9, PHP 5.3.10.

I have recently upgraded my moodle directory, using Git, from 2.5.3 to 2.6. I have also added ZendOPCache as a module in my PHP install, this was suggested on the server environment check before upgrading. 

Now, when I go to localhost/moodle I get an error message telling me that the server has sent nothing. If I go to localhost /moodle/admin I get the site upgrade screen but it comes up without any CSS (see image bellow).

If I remove OPCache from my PHP modules, by commenting out the path in my php.ini files, moodle seems to work fine. I opened localhost/moodle and it gave me the usual message telling me that the site is in maintenance mode, also, if I open localhost/moodle/admin it asks me If I would like to Upgrade the site to 2.6+ with all the nice CSS there.

I haven't gone through with the site upgrade when OPCache is disabled as I would like to do it only once everything is working as it should be, but it seems the site nonetheless works well when OPCache is disabled and doesn't work too well when OPCache is enabled. 

Please can somebody help me out.

Regards

Shane Drower-Copley

Attachment 2 (1).png
Average of ratings: -
In reply to Shane Drower-Copley

Re: OPCACHE causing problems with 2.6 upgrade

by Shane Drower-Copley -

Hi again,

It seems my OPcache module is creating problems for my whole server rather than simply my moodle installation. I tried opening phpmyadmin and it gave me the same problems as when I had tried to open moodle. With OPcache enabled my browser would tell me that the server had sent no data, with OPcache disabled my browser opened phpmyadmin and it worked perfectly.

Anyone got any ideas on help?

I will post the topic in a forum more focused on PHP but in case anyone here has had any experience with this, I thought I would leave this post up (if I'm allowed that is)

Regards

Shane 

In reply to Shane Drower-Copley

Re: OPCACHE causing problems with 2.6 upgrade

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Yes - I would forget about opcache in your configuration. 

In my testing it is unstable in PHP <5.5. In 5.5 it is built in and works fine. You are probably better to stick with APC and ignore the warning until you can upgrade your PHP. 

In reply to Shane Drower-Copley

Re: OPCACHE causing problems with 2.6 upgrade

by Nathan Bailey -

I am having the same issues, I tried with PHP 5.4 and 5.5 but am getting the empty response when OpCache is enabled. 

Interestingly I am getting this error message in my apache log:

PHP Fatal error:  Cannot redeclare class lesson in /var/www/tss/mod/lesson/locallib.php on line 890

It only happens on Moodle pages that disable caching such as the admin page and individual courses.

In reply to Nathan Bailey

Re: OPCACHE causing problems with 2.6 upgrade

by Aldemar Calazans Filho -

Perhaps the information below, found at oficial PHP site (http://www.php.net/manual/en/opcache.configuration.php) may help you:

 opcache.dups_fix boolean
    This hack should only be enabled to work around "Cannot redeclare class" errors.

 

By the way, boolean means "0" or "1", so, to activate this directive in your php configuration file, you must add the line:

opcache.dups_fix=1