William Jiang

JavaScript,PHP,Node,Perl,LAMP Web Developer – http://williamjxj.com; https://github.com/williamjxj?tab=repositories

Tag Archives: APC

Affecting PHP’s Behaviour

Affecting PHP’s Behaviour

While we are immersed in work, it is better to look up and think see if there is some shortcut way for the solution.
The following is from php.net, for PHP performance collection:


  • APC — Alternative PHP Cache
  • APD — Advanced PHP debugger
  • bcompiler — PHP bytecode Compiler
  • BLENC — Blenc – BLowfish ENCoder for PHP source scripts
  • Error Handling — Error Handling and Logging
  • htscanner — htaccess-like support for all SAPIs
  • inclued — Inclusion hierarchy viewer
  • Output Control — Output Buffering Control
  • PHP Options/Info — PHP Options and Information
  • scream — Break the silence operator
  • Weakref — Weak References
  • WinCache — Windows Cache for PHP
  • Xhprof — Hierarchical Profiler

PHP APC vs. Memcached

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.

PHP Performance APC + Memcached

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