First of all, what is APC? It is actually two things: a byte code cache, which works by caching pre-interpreted PHP code, and a user level cache which will cache whatever you send it as a string.
A problem faced by new VPS clients that selected PHP 5.5, is that most people select PHP 5.5 which comes with Zend OpCache integrated. This new OpCache performs the same function as APC’s byte code cache and so, conflicts with the extension. So if you have PHP 5.5 installed and then they try to install APC as well, you’ll get errors instead of your page.
OpCache comes enabled by default, which is great on production servers where the code doesn’t change often, but it’s not good for testing or development environments. When the cache is enabled it compiles the PHP code of your site into byte codes & stores that into memory. Then the next request just runs that compiled code in memory. So if you make a change to a configuration that should make the site behave differently, you will not see the changes.
If the VPS is going to be used for development or testing purposes then you should disable OpCache by changing the following line in php.ini and then restarting Apache:
opcache.enable = “1” (it may say “On”)
opcache.enable = “0” (or “Off”)
sudo apt-get install php55-apcu
sudo yum intall php55-apcu
If you’re not running PHP 5.5 and APC is not already installed on your server, then you can run:
The same will work with php53 for PHP 5.3.