Linux系统下让PHP提高性能的工具APC
admin | 技术教程, 服务器相关 | 八月 18th, 2012 | No Comments »
当前我用的是APC-3.1.19 stable ,用户自己到 http://pecl.php.net/package/APC 下载最新版。
①安装
wget http://pecl.php.net/get/APC-3.1.19.tgz
tar xzvf APC-3.1.19.tgz
/usr/local/webserver/php/bin/phpize
./configure –enable-apc –enable-apc-mmap –with-php-config=/usr/local/php/bin/php-config –prefix=/usr/local/apc
make && make install
注:安装编译后检查相应目录:
ll /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/
-rwxr-xr-x 1 root root 416628 12-15 17:13 apc.so
安装成功!
②配置/etc/php.ini
vi /usr/local/php/etc/php.ini
shift+g到最末行,末尾加入
[APC]
extension=”apc.so”
apc.enabled = On
apc.shm_segments = 1
apc.optimization = 0
apc.num_files_hint = 0
apc.ttl = 7200
apc.user_ttl = 7200
apc.cache_by_default = On
apc.slam_defense = 0
apc.file_update_protection = 2
apc.enable_cli = 0
apc.shm_size = 2050M
apc.write_lock = On
apc.stat=0
然后把APC目录下的apc.php复制到可以访问的目录
cp /usr/local/src/APC-3.1.19/apc.php /home/www/htdocs/
③重启Web服务器
发表评论
你必须 登录 才能发表评论.