給在生產環境下給php安裝apc加速擴展腳本


關於apc的理論網上不少,宅鳥再也不作贅述:php

直接上腳本:
bash


#!/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
相關文章
相關標籤/搜索