Compiling PHP and zend optimizer

Any advice about getting Zend optimizer ibn user compiled PHP?

As a related question, how do you get Zend Optimizer working using any method: module, cgi, or custom-compiled? I read in the newsletter ( 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?

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 ./, you can manually install Zend Optimizer.

  1. Download Zend Optimizer:

$ cd ~
$ mkdir zend
$ cd zend
$ wget

  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 ~/lib/php/

  1. Edit php.ini:

$ nano ~/

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

; Zend Optimizer options

  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:

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

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()?

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

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:


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