给在生产环境下给php安装apc加速扩展脚本
关于apc的理论网上很多,宅鸟不再做赘述:
直接上脚本:
#!/bin/bash # name:apc.sh # description: # author:lihuibin # version: 0.0.1 # datetime: 2013-08-22 14:44:33 # usage:apc.sh wget http://pecl.php.net/get/APC mv APC APC-3.1.13.tgz tar -zxvf APC-3.1.13.tgz cd APC-3.1.13/ /usr/bin/phpize ./configure --enable-apc --enable-apc-mmap --with-php-config=/usr/bin/php-config make make install cd /etc/php5/conf.d/ cat > apc.ini << EOF extension=apc.so [apc] apc.enabled=1 apc.shm_segments=1 apc.shm_size=30M apc.ttl=7200 apc.user_ttl=3600 apc.stat =1 apc.stat_ctime = 0 apc.max_file_size = 1M EOF /etc/init.d/php5-fpm reload