The APC caching is broken in Joomla! according to my experience. Actually, that's not quite accurate. When you are using a PHP caching mechanism which is not APC itself but provides an APC-compatible interface (e.g. opcache, Zend Data Cache) Joomla!'s APC cache handler is completely broken. I found out the Hard Way™: I'm using Zend Server for development. Once I upgraded to Zend Server 7.0 last year, which was the first release to use PHP 5.5, my dev sites were impossible to log in when using the APC handler for sessions. Oops!
As you figured out, the best way to move forward is to switch the caching of your sites to File
and make sure that the session handler is set to Database. Then you can enable PHP 5.5 by default on your server.
A much better alternative which can be implemented
after switching to PHP 5.5 is enabling memcache on your server. memcache is an in-memory cache key store, similar to APC but without opcode caching.
OK, let me explain the terms here:
* cache key store. A key is assigned to a value. Each request results in a key value which describes it uniquely. Identical requests have the same key. If the key exists in the store Joomla! doesn't go through page rendering. It retrieves the value of the key from the cache and returns it instead. Keys also have a built in expiration timer. If the key expires it is expunged from the cache, so Joomla! will regenerate the page. The File method stores the key values in the filesystem, inside the cache and administrator/cache directories. APC, memcache and other
in-memory caches store these values in the server's RAM. RAM is orders of magnitude faster than the filesystem, therefore increasing performance on busy servers.
* op-code cache. This is what APC and opcache both do. When you "run" a PHP script the .php file has to be loaded from memory, go through the PHP language parser and get converted to an intermediate binary format called op-code. Then the guts of the PHP runtime (Zend Engine) execute this op-code. The .php file text to op-code conversion takes some time which can be as much as 20% of the request time. The op-code cache keeps this parsing result in memory. As long as it detects that the file hasn't changed on disk it will server the op-code stored in memory, therefore shaving off 5% to 20% of the request time. If the file changes on the disk it understands that it needs to parse the file afresh, updating the results of the op-code cache.
Back in PHP 5.3 and lower APC performed a dual role: it was BOTH and op-code cache AND an in-memory key-value cache store. Since PHP 5.5 there is no longer a need for an op-code cache since the very performant opcache (formerly Zend OPcache – it used to be a for-a-fee solution!) is built into PHP itself. This leaves us with the need for an in-memory cache. Since your server doesn't provide the straight-up APC you can switch to memcache. The major differences between APC and memcache are:
* APC only runs inside PHP. memcache is a daemon running on the server itself, outside PHP. APC's contents get lost when the web server daemon is restarted. memcache's contents are not lost in this case.
* APC is strictly single-server. It must run on the server where PHP runs. memcache can be distributed or even remote. If you have a super-busy site you can buy another dedicated server which runs nothing else but memcache itself. You can then off-load caching to that dedicated server. At the scale our typical Joomla! sites operate this is an overkill, but at least you know there's this option.
That's the executive summary of these technologies.
TL;DR – What should I do?
* Set Cache Handler to File
* Set Session Handler to Database
* Switch to PHP 5.5
* Ask your host if they can enable memcache. If they can, change the two handlers to memcache.
As for PHP 5.3, your host merely needs to set
magic_quotes_gpc=Off
in your server's php.ini file.
Nicholas K. Dionysopoulos
Lead Developer and Director
🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!