PHP擴充套件快取加速安裝

科技小能手發表於2017-11-12

所需要軟體:
eaccelerator-0.9.6.1.tar.bz2
memcache-2.2.5.tgz

PDO_MYSQL-1.0.2.tgz

ImageMagick-6.6.1-10.tar.gz

imagick-2.3.0.tgz

ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz

—————————————
eaccelerator PHP解析cache加速

 

tar jxvf eaccelerator-0.9.6.1.tar.bz2

cd eaccelerator-0.9.6.1

/usr/local/php/bin/phpize

./configure –enable-eaccelerator=shared –with-php-config=/usr/local/php/bin/php-config

make

make install

cd ..

 
memcache client ext

 

tar zxvf memcache-2.2.5.tgz

cd memcache-2.2.5

/usr/local/php/bin/phpize

./configure –with-php-config=/usr/local/php/bin/php-config

make

make install

cd ..

 

Zend framework

 

tar zxvf PDO_MYSQL-1.0.2.tgz

cd PDO_MYSQL-1.0.2

/usr/local/php/bin/phpize  

./configure 

–with-php-config=/usr/local/php/bin/php-config –with-pdo-mysql=/usr/local/mysql

make

make install

cd ..

 

ImageMagick(圖片處理)

 

 

tar zxvf ImageMagick-6.6.1-10.tar.gz

cd ImageMagick-6.6.1-10

./configure

make

make install

cd ..

tar zxvf imagick-2.3.0.tgz

cd imagick-2.3.0

/usr/local/php/bin/phpize

./configure –with-php-config=/usr/local/php/bin/php-config

make

make install

cd ..

 

Zend php解析cache加速

 

tar zxvf ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz

cd ZendOptimizer-3.3.9-linux-glibc23-i386

cd data/5_2_x_comp

cp ZendOptimizer.so /usr/local/php/lib/php/extensions/no-debug-zts-20060613/

cd ..

ll /usr/local/php/lib/php/extensions/no-debug-zts-20060613/

 

配置相關PHP的擴充套件

——————————————-

 

vi /usr/local/php/lib/php.ini

查詢 extension_dir=”./”  (約486行)   

新增路徑

extension_dir = “/usr/local/php/lib/php/extensions/no-debug-zts-20060613/”

 

在結尾處新增下面幾行,儲存退出

  extension=memcache.so

  extension=pdo_mysql.so

  extension=imagick.so

 

配置eaccelerator加速PHP解析

 

mkdir -p /tmp/eaccelerator

chmod -R 777 /tmp/eaccelerator

vi /usr/local/php/lib/php.ini

在結尾處新增下面幾行(注意:放在Zend配置前)

[eaccelerator]  

extension=eaccelerator.so  

eaccelerator.shm_size=”64″  

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″  

 

配置完畢!

 

#/usr/local/php/bin/php -v               //檢查加速情況配置

#ls -l /tmp/eaccelerator                 //檢查是否有快取內容,有就正常啦

開啟瀏覽器檢視PHP測試頁,看memcache外掛是否已生效

轉載請註明: 轉載自http://www.elain.org

本文連結地址:PHP擴充套件快取加速安裝

本文轉自 elain2012 51CTO部落格,原文連結:http://blog.51cto.com/elain/640217


相關文章