Notice: PHP cache may cause problems after update

Notice: PHP cache may cause problems after update

by Maik Riecken -
Number of replies: 12
Dear community,

Updating 1.7 or 1.8 may cause obscurious errors (admin account no longer recognised, blank screens, misleaded script calls etc.). I found out that almost every problems is caused by php caches.

They should be emptied (resetted) soon after update - and everything will be fine again. I really don't know why only 1.7 and 1.8 upgrades are showing this behaviour. Maybe one of the developers may know - must have to do with the new caching features, maybe...

my server software specs:
lighttpd + PHP5.2.0 running as fastcgi (both debian etch) + xcache (selfcompiled).

I'm checking out APC now...

Like described in

http://moodle.org/mod/forum/discuss.php?d=68710

I am using one installation of moodle for several instances. Maybe this increases problematics...

regards,

Maik

Average of ratings: -
In reply to Maik Riecken

Re: Notice: PHP cache may cause problems after update

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Yes indeed, I've noticed this too and am now clearing PHP caches as a matter of course after an upgrade.

I think the problem is mostly related to the class changes in auth, which for some reason some PHP caches seem to have trouble dealing with (eg PHPA). eAccelerator seems not to be affected.
In reply to Martin Dougiamas

Re: Notice: PHP cache may cause problems after update

by Maik Riecken -
Hi Martin,

Thanks for the reply.

Xcache and apc are showing the same behaviour even after a reset of a cache (if they're running for a while...) - not good. Must have something to do with f(cgi). But I hate apache... :o(...

I am trying out eAccelerator now (I've become the master of compilation last night...). Should run even with (f)cgi - lighttpd.org says so... Otherwise I have to face a reverse proxy...

Maik


In reply to Maik Riecken

Re: Notice: PHP cache may cause problems after update

by Maik Riecken -
Same with eAccelerator... (debian etch) Only disabling PHP-cache makes our sites running properly.

Ok. Reverse proxy then...

Maik
In reply to Maik Riecken

Re: Notice: PHP cache may cause problems after update

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Maik,

running PHP 5.2 + eAccelerator v0.9.5 under Debian (sarge) seems to be working fine here.

I remember I cleared/purged/cleaned caches after upgrade but that was all.

Ciao smile
In reply to Eloy Lafuente (stronk7)

Re: Notice: PHP cache may cause problems after update

by Maik Riecken -
Hello Eloy,

No way here... Problems are returning even when starting a fresh compiled cache. Purge has effect for five minutes.

You may take a direct look at our setup (which is a bit very special, I've attached a graphic) , if you want. Just feel invited to contact me directly.

It looks like a PHP-bug for now...

Maik







Attachment function_scheme.gif
In reply to Maik Riecken

Re: Notice: PHP cache may cause problems after update

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Just one more possibility...

Have you seen/used this: http://eaccelerator.net/ (it seems that some patch is required to work properly under PHP 5.2). I haven't it applied in my server but...

Some details about my PHP installation...

PHP Version 5.2.0-8
Server API Apache 2.0 Handler
PHP API 20041225
PHP Extension 20060613
Zend Extension 220060519

Ciao smile
In reply to Eloy Lafuente (stronk7)

Re: Notice: PHP cache may cause problems after update

by Maik Riecken -
Better, but not good...

Error comes only with the notification page now. After activating eaccelerator, I'm getting this (only this, page is white):



Debugging mode shows:
Fatal error: Cannot redeclare class auth_plugin_manual in /path/to/moodlel/auth/manual/auth.php on line 23

Switching to cache mode "eaccelerator" shows:
Fatal error: Call to undefined function _rm() in /path/to/moodle//lib/eaccelerator.class.php on line 65

Strange...

By the way: Settings of another cachetype (settings => server => performance => cachetype) is not protected. If wanted cache is not present you'll be bunged off your moodle (as long as you don't change mdl_config value back). I added this to bugtracker as an improvement.

regards,

Maik



In reply to Maik Riecken

Re: Notice: PHP cache may cause problems after update

by Maik Riecken -

Solution found!

It has definitly to do with my setup. All caches seem to work filesystem based. Cached elements seem to be recognized by pathinfo. My config.php is dynamic.

/path/to/config.php

is not

/path/to/config.php

because any config.php is dynamic (generated by HTTP request). But all caches belive that they were equivalent... If I exclude config.php from cache, everything seems to be fine again (using eAccelerator now).

But moodle must have changed in this point, too. Moodle1.6 was working fine... Puh...

regards,

Maik

In reply to Maik Riecken

Re: Notice: PHP cache may cause problems after update

by Benton Jackson -

I've found that this happens when I have Zend Platform installed. My coworker wasn't getting the problem and I was, and when he installed Zend to do some debugging he was getting the problem. Zend Platform seems to install it's own cache facility, and I haven't figured out how to make it stop.

In reply to Maik Riecken

Re: Notice: PHP cache may cause problems after update

by Detlef Anschlag -
Hi Maik,

I got the same error after I had installed eaccelerator. I proved that eaccelerator works: with php -v, in the cache directory everything says, that it works.

You've said, that you found a solution for that error:

Fatal error
: Call to undefined function: _get() in /srv/www/vhosts/maria-sibylla-merian.net/httpdocs/moodle/lib/eaccelerator.class.php on line 56

What do I have to do?

Regards,
Detlef
In reply to Maik Riecken

Re: Notice: PHP cache may cause problems after update

by PROFessor VAZZ - Brazil -

I have moodle 1.8.

How Can I to change setting server to none, because I don't get to access my moodle.

Fatal error: Call to undefined function _rm() in /path/to/moodle//lib/eaccelerator.class.php on line 65

Tks a lot.

PROFessor VAZZ

Brazil

In reply to PROFessor VAZZ - Brazil

Re: Notice: PHP cache may cause problems after update

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
I think this will work but I'm not 100% sure. I doubt it would do any harm. If you have access to phpmyadmin or someway of getting to your database you could do something like:

UPDATE mdl_config SET value='' WHERE name = 'cachetype';

To set it back to eaccelerator:

UPDATE mdl_config SET value='eaccelerator' WHERE name = 'cachetype';

Hopefully this will help you out. Peace - Anthony