The DoYouHaoBaby PHP Framework中文开发文档手册
Copyright(c) DoYouHaoBaby.NET All Rights Reserved.
[ Linux服务器上如何安装APC(Alternative PHP Cache) ]
下面是安装方法:

  1. extension=php_apc.dll   
  2. apc.enabled = 1   
  3. apc.shm_segments = 1   
  4. apc.shm_size = 64   
  5. apc.optimization = 0   
  6. apc.num_files_hint = 1000   
  7. apc.ttl = 0   
  8. apc.gc_ttl = 3600   
  9. wget http://pecl.php.net/get/APC-3.1.2.tgz   
  10. tar zxvf APC-3.1.2.tgz   
  11. cd APC-3.1.2/   
  12. /usr/local/php/bin/phpize   
  13. ./configure --enable-apc --enable-apc-mmap --with-php-config=/usr/local/php/bin/php-config   
  14. make   
  15. make install  

 配置php.ini 末尾加入:

  1. apc.enabled = 1   
  2. apc.cache_by_default = on   
  3. apc.shm_segments = 1   
  4. apc.shm_size = 32   
  5. apc.ttl = 600   
  6. apc.user_ttl = 600   
  7. apc.num_files_hint = 0   
  8. apc.write_lock = On   

 然后重启服务器就OK。

删除APC的方法

查找extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/"
将extension = "apc.so" 删掉...

打开 php.ini 找到下面的删除:

  1. apc.enabled = 1   
  2. apc.cache_by_default = on   
  3. apc.shm_segments = 1   
  4. apc.shm_size = 32   
  5. apc.ttl = 600   
  6. apc.user_ttl = 600   
  7. apc.num_files_hint = 0   
  8. apc.write_lock = On  

 
然后重启服务器就OK。