原来安装的PHP加速软件是ZendOptimizer,这次重装系统,由于PHP版本升级到5.3,原来的ZendOptimizer只能支持到5.2,通过网上搜索,发现最新的PHP加速软件更名为ZendGuardLoader,以下是ZendGuardLoader及eaccelerator的安装步骤:
一、ZendGuardLoader5.5安装
1、下载Zend Guard
32位 http://downloads.zend.com/guard/5.5.0/ZendGuardLoader-php-5.3-linux-glibc23-i386.tar.gz
64位 http://downloads.zend.com/guard/5.5.0/ZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gz
sudo mkdir /usr/zend
tar -zxvf ZendGuardLoader-php-5.3-linux-glibc23-i386.tar.gz
Sudo cp ZendGuardLoader/php5.3.x/ZendGuardLoader.so /usr/zend/
2、配置
sudo vim /etc/php5/apache/php.ini
最后加上:
zend_extension=/usr/zend/ZendGuardLoader.so
zend_loader.enable=1
zend_loader.disable_licensing=0
zend_loader.obfuscation_level_support=3
zend_loader.license_path=
重启web服务器软件
二、eaccelerator安装
mkdir /tmp/eaccelerator
chmod 0777 /tmp/eaccelerator
wget http://bart.eaccelerator.net/source/0.9.6.1/eaccelerator-0.9.6.1.tar.bz2
tar xvjf eaccelerator-0.9.6.1.tar.bz2
cd eaccelerator-0.9.6.1
cp control.php /var/www/control.php //复制控制程序到网站目录,通过http://网站名/control.php访问,默认帐号为admin,密码为eAccelertor,可编辑此文件修改。
phpize:如果不能运行,先运行apt-get install php5-dev安装php5-dev,再运行phpize
sudo ./configure --enable-eaccelerator=shared
sudo make
sudo make install
sudo vim /etc/php5/apache/php.ini
在配置文件php.ini最后加上:
代码:zend_extension="/usr/lib/php5/20090626+lfs/eaccelerator.so"
eaccelerator.shm_size="16"
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="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
eaccelerator.allowed_admin_path="/var/www/control.php"
在phpinfo里如果出现如下信息,表示安装成功:This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies
with eAccelerator v0.9.6.1, Copyright (c) 2004-2010 eAccelerator, by eAccelerator