The Alternative PHP Cache (APC) is a fantastic free and open opcode cache for PHP and does a great job at caching and optimizing PHP intermediate code. We all know what it does and how it works.
Sometimes we don’t want it enabled for all sites on a server (Using php.ini or conf.d/apc.ini), for example, you have a dev site and a live site on the same server. Having APC enabled on a dev site can be a little annoying.
Edit your php.ini or conf.d/apc.ini and disable APC by changing
to (Or, if that line doesn’t exist, just add the following;)
Now, in our live site (or site we want APC to be active on) we add the following to the .htaccess or vhost config
php_flag apc.cache_by_default On