Compiling PHP and zend optimizer

software development

#1

Any advice about getting Zend optimizer ibn user compiled PHP?


#2

As a related question, how do you get Zend Optimizer working using any method: module, cgi, or custom-compiled? I read in the newsletter (https://panel.dreamhost.com/kbase/index.cgi?area=3126&keyword=zend) that it had been implemented on all servers, but phpinfo() doesn’t show a zend section and doesn’t include the Zend Optimizer copyright notice where it should, immediately following the zend engine copyright notice.

Do I need to turn it on somehow? Or is compiling PHP required?


#3

I think I figured out the answer to your question and in the process answered mine. While you don’t have root access to use ./install.sh, you can manually install Zend Optimizer.

  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

  1. 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

  1. 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/

  1. 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/

  1. Edit php.ini:

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

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

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

  1. Check your phpinfo() for these lines:

This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright © 1998-2004 Zend Technologies with Zend Optimizer v2.5.10, Copyright © 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


#4

You may need the rest of the files in this post as well:

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


#5

I had done everything that you instructed. but will that compile ZendOptimizer to my own PHP?? It seems not work…

Only thing I didn’t do it to check phpinfo(). how do I do that? where is phpinfo()?


#6

Is this because I am using ZendOptimizer-2.6.2 version and not 2.5.10a?


#7

phpinfo() is a PHP function that generates a display of various information about your PHP installation.

To use it, just create a small php program with a text editor, and run that program in a browser.

See this DH wiki page/link for an example of a phpinfo program. :wink:

–rlparker


#8

Thanks it works! I copied the wrong .so file. I copied _TS.so file…which is wrong…