PHP APC vs. Memcached
Blogs20132013-02-25
PHP APC vs. Memcached
APC is Alternative PHP Cache. I used some of PHP Memcached in projects but not APC. By reading the PHP APC documents, I found it even more easy to use than Memcached. According to PHP documents:
- Memcached if you need to preserve state across several web servers (if you’re load balanced and it’s important that what’s in the cache is the same for all servers).
- APC if you just need access to quick memory to read (& write) on a (or each) server.
Remember APC can also compile and speed up your script execution time. So you could for example be using APC for increased execution performance, while using memcached for cache storage.
In my CentOS server, the config is at: /etc/php.d/apc.ini:
; Enable apc extension module
extension = apc.so
...
// and can be viewed at:
$ php -r 'phpinfo();' |grep apc