PHP APC and Gallery Issues
PHP offers a PECL package called APC or Alternative PHP Cache that can significantly increase performance on your LAMP server with high loads. I have seen significant decreases in performance issues over the time that I have tested it. However, once I had turned it on, I noticed some serious problems with PHP Gallery and since I was short on time, I figured I would turn it off till I could find a good solution to the problem.
Gallery will return an “undefined method” or an obscure security error with APC turned on. This is mostly evident on Gallery 2. Restarting the apache webserver normally solves this problem temporarily. I had tried to turn off the performance peice inside Gallery to see if the caching was crossing hairs with APC. That did not solve the problem. (Wordpress cache might also have problems with APC, that needs addressed as well).
To make a long story short, I found the answer by trial and error. Turning off APC for Gallery classes normally fixes the problem. I built a filter for APC in php.ini that kept the Gallery files from being cached by APC. After searching some more, I found a more complete solution on the Gallery forums.
Just add the following line to the APC config inside php.ini, right above the apc.mmap_file_mask line:
apc.filters="-Gallery.*\.class"
Your gallery should work without any further trouble.
1 Comment »
The URI to TrackBack this entry is: http://mindfulmusings.net/weblog/2006/05/19/php-apc-and-gallery-issues/trackback/
RSS feed for comments on this post.
Leave a comment
Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>
Which version of APC? I’m running APC-3.0.12p2 on my webserver, with the current SVN version(s) of Gallery 2 without any problems at all. Gallery 2 is one of those applications that really makes use of bytecode caching when it’s available to it, and it would be a shame to not utilize it fully if you can.
Comment by Christian Mohn 2/22/2007 @ 11:23 am