上一篇: linux 查看硬盘性能
安装apc为php加速
[ 2009/07/21 12:25 | by selboo ]
Alternative PHP Cache(APC)是 PHP 的一个免费公开的优化代码缓存。它用来提供免费,公开并且强健的架构来缓存和优化 PHP 的中间代码。
主要是加速PHP..
WordPress是一个占用内存的大户,而且执行效率比较低..
我安装了APC后,VPS的整体内存降了30M左右吧..
下面是安装方法:
wget http://pecl.php.net/get/APC-3.1.2.tgz
tar zxvf APC-3.1.2.tgz
cd APC-3.1.2/
/usr/local/php/bin/phpize
./configure --enable-apc --enable-apc-mmap --with-php-config=/usr/local/php/bin/php-config
make
make install
tar zxvf APC-3.1.2.tgz
cd APC-3.1.2/
/usr/local/php/bin/phpize
./configure --enable-apc --enable-apc-mmap --with-php-config=/usr/local/php/bin/php-config
make
make install
配置php.ini 末尾修改加入
extension_dir = "/usr/local/php5.2.9/lib/php/extensions/no-debug-non-zts-20060613/"
extension = "apc.so"
[APC]
apc.enabled = 1
apc.cache_by_default = on
apc.shm_segments = 1
apc.shm_size = 32
apc.ttl = 600
apc.user_ttl = 600
apc.num_files_hint = 0
apc.write_lock = On
extension = "apc.so"
[APC]
apc.enabled = 1
apc.cache_by_default = on
apc.shm_segments = 1
apc.shm_size = 32
apc.ttl = 600
apc.user_ttl = 600
apc.num_files_hint = 0
apc.write_lock = On
然后重启服务...
查看状态
http://www.selboo.com.cn/apc.php
最后编辑: selboo 编辑于2010/07/16 04:53
也没感觉出有多快
请加上链接