luckymaoyy 2010-11-09
下载Zend Optimizer
sudo wget http://downloads.zend.com/optimizer/3.3.9/ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
解压
sudo tar zxvf ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
cd ZendOptimizer-3.3.9-linux-glibc23-i386/data/
里面有PHP对应的版本,选择你需要的,
sudo cp ZendOptimizer.so /usr/local/webserver/php/lib/php/extensions/debug-non-zts-20060613/
然后设置php.ini
加入
zend_optimizer.optimization_level=15 #优化等级
zend_extension=ZendOptimizer.so #指定优化SO地址
zend_optimizer.encoder_loader=0 #是否支持加密代码
下载eAccelerator
sudo wget http://bart.eaccelerator.net/source/0.9.6/eaccelerator-0.9.6.tar.bz2
解压
sudo tar jxvf eaccelerator-0.9.6.tar.bz2
编译php扩展
sudo /usr/local/webserver/php/bin/phpize
sudo ./configure --with-php-config=/usr/local/webserver/php/bin/php-config
sudo make
sudo make install
修改php.ini配置加入到zend配置上面
extension=eaccelerator.so
eaccelerator.shm_size="32"
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"
重启php-cgi
OK啦。
phpinfo中发现 ZendOptimizer没有加载上,不知道为什么,先不忙搞了,这两天有其他事情做,等空了慢慢来弄下
<?php. if (!empty($_POST)) {. $data1 = $_POST["data1"];$data2 = $_POST["data2"];$fuhao = $_POST["fuh