您好,登錄后才能下訂單哦!
#!/bin/sh
##一鍵優化lamp之php
#安裝eaccelerator緩存加速器
cd /home/lvnian/tools
tar jxf eaccelerator-0.9.6.tar.bz2
cd eaccelerator-0.9.6
/application/php/bin/phpize
./configure --enable-eaccelerato=shared --with-php-config=/application/php/bin/php-config
echo $?
make && make install
ls -l /application/php5.3.27/lib/php/extensions/no-debug-zts-20090626/
######編譯安裝xcache,xcache和eaccelerator都是加速模塊,在生產中選擇一個安裝就可以了
cd /home/lvnian/tools
tar jxf xcache-1.3.2.tar.bz2
cd xcache-1.3.2
/application/php/bin/phpize
./configure --enable-xcache --with-php-config=/application/php/bin/php-config
echo $?
make && make install
ls -l /application/php5.3.27/lib/php/extensions/no-debug-zts-20090626/
###安裝PDO_MYSQL擴展插件(可選擇的)
cd /home/lvnian/tools
tar zxf PDO_MYSQL-1.0.2.tgz
cd PDO_MYSQL-1.0.2
/application/php/bin/phpize
./configure --with-php-config=/application/php/bin/php-config \
--with-pdo-mysql=/application/mysql
echo $?
make && make install
ls -l /application/php5.3.27/lib/php/extensions/no-debug-zts-20090626/
###安裝數據量Memcache緩存客戶端軟件(客戶端軟件)
cd /home/lvnian/tools
tar zxf memcache-2.2.5.tgz
cd memcache-2.2.5
/application/php/bin/phpize
./configure --with-php-config=/application/php/bin/php-config
make && make install
ls -l /application/php5.3.27/lib/php/extensions/no-debug-zts-20090626/
###安裝圖像軟件
yum -y instals -l perl-CPAN
cd /home/lvnian/tools
tar zxf ImageMagick.tar.gz
cd ImageMagick-6.5.1-2/
./configure
make && make install
##安裝擴展插件
cd /home/lvnian/tools
tar zxf imagick-2.3.0.tgz
cd imagick-2.3.0
/application/php/bin/phpize
./configure --with-php-config=/application/php/bin/php-config
make && make install
ls -l /application/php5.3.27/lib/php/extensions/no-debug-zts-20090626/
##配置php加速和緩存模塊擴展
cp /application/php/lib/php.ini /application/php/lib/php.ini.ori
grep ' extension_dir = "./"' /application/php/lib/php.ini
sed -i 's#; extension_dir = "./"#extension_dir = "/application/php/lib/php/extensions/no-debug-zts-20090626/"#g' /application/php/lib/php.ini
grep 'extension_dir = ' /application/php/lib/php.ini
cat >> /application/php/lib/php.ini <<eof
extension = memcache.so
extension = pdo_mysql.so
extension = imagick.so
eof
##配置eaccelerator 緩存目錄
grep User /application/apache/conf/httpd.conf
mkdir -p /tmp/eaccelerator
chown lvnian.lvnian /tmp/eaccelerator -R
##配置eaccelerator參數
cat >>/application/php/lib/php.ini<<eof
[eaccelerator]
extension=eaccelerator.so
eaccelerator.shm_size="128"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="3600"
eaccelerator.shm_prune_period="3600"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
eof
echo "------------php eaccelerator-------------"
/application/php/bin/php -v
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。