PHP - 如何手工安装zend optimizer

来源:互联网 发布:酷派8730l系统优化不动 编辑:程序博客网 时间:2024/05/09 02:33

如果没有root权限可以采用下面这个方法进行安装.当然如果有,则不必这么麻烦,直接使用二制安装程序安装.

 

1. Download Zend Optimizer:

$ cd ~
$ mkdir zend
$ cd zend
$ wget http://downloads.zend.com/optimizer/2.5.10/ZendOptimizer-2.5.10a-linux-glibc21-i386.tar.gz

2. Extract the archive:

$ gunzip ZendOptimizer-2.5.10a-linux-glibc21-i386.tar.gz
$ tar -xvf ZendOptimizer-2.5.10a-linux-glibc21-i386.tar
$ cd ZendOptimizer-2.5.10a-linux-glibc21-i386

3. Find the directory in ./data that matches your PHP version (Replace 4_4_x_comp with your version):

$ cd data/
$ cd 4_4_x_comp/

4. Copy the .so file into your php tree. (I wasn't sure of the best place to put it, so I chose ~/lib/php.

$ cp ZendOptimizer.so ~/lib/php/

5. Edit php.ini:

$ nano ~/example.com/cgi-bin/php.ini

6. Add the configuration options anywhere in php.ini:

; Zend Optimizer options
zend_optimizer.optimization_level=15
zend_extension=/home/USERNAME/lib/php/ZendOptimizer.so

7. Check your phpinfo() for these lines:

This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies with Zend Optimizer v2.5.10, Copyright (c) 1998-2005, by Zend Technologies

and a Zend Optimizer section. You could also try 1023 instead of 15.

More info on that value:
http://www.zend.com/phorum/read.php?id=4261&num=5&thread=4261

 

参考:

http://www.vbulletin.com/forum/archive/index.php/t-107885.html

http://forum.dreamhosters.com/programming/28526-Compiling-PHP-and-zend-optimizer.htm