Linux下PHP加速器APC的安装与配置
一、安装
wget http://pecl.php.net/get/APC-3.1.9.tgz
tar xzvf APC-3.1.9.tgz
cd APC-3.1.9
/usr/local/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-20090626/
-rwxr-xr-x 1 root root 659164 Apr 8 18:30 apc.so
安装成功
二、配置/usr/local/php/etc/php.ini
vi /usr/local/php/etc/php.ini
末尾加入
extension=”/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/apc.so”
apc.enabled = 1
apc.cache_by_default = on
apc.shm_segments = 1
apc.shm_size = 64
apc.ttl = 7200
apc.user_ttl = 7200
apc.num_files_hint = 0
apc.write_lock = On
三、重启服务器
service httpd restart
兄弟连IT教育为你解决更多IT问题。