PDA

View Full Version : HOWTO: install Zend Optimizer 2.5.7 ono PHP 4.3.10



nsc
02-22-2005, 08:49 PM
I just installed Zend Optimizer 2.5.7 on my PHP 4.3.10, but of course I couldn't do it without the instructions found in these messages: 1 (http://forums.westhost.com/phpBB2/viewtopic.php?t=2793), 2 (http://forums.westhost.com/phpBB2/viewtopic.php?p=15080#15080).

In this message I collected all the instructions in a single message.

Here is what you need to do to install Zend Optimizer 2.5.7 on PHP 4.3.10:

1. Download it (http://www.zend.com/store/free_download.php?pid=13). You can download it to your PC and then upload it to your site, but it is much easier to do that directly on SSH (PuTTY). Unfortunately it doesn't seem to work with wget, but I found that I could download it via Lynx. What you need to do is to type "Lynx http://www.zend.com/store" in SSH and find the Zend Optimizer product. Then find the link for the "Linux glibc2.1" download. You can navigate in Lynx using the up and down arrow keys. To follow a link just press the right arrow key. Lynx will ask you whether you want to download the file and for its file name. It will save the file either in the homedir or the current dir (I am not sure which one).

2. Uncompress it: tar -zxvf [filename]

3. cd in the newly created directory

4. type "pico install.sh" and find a line which says "if [ ! -z "$MYUID" ];". You need to comment this line and the next 6 lines. Here's how it will look like after commenting:



#if [ ! -z "$MYUID" ];
#then
# if [ $MYUID != 0 ];
# then
# error "You need root privileges to run this script!";
# fi
#fi


Save the file by pressing CTRL+S and then Enter and CTRL+X.

5. type "./install.sh"

6. It will ask you where you want to install Zend Optimizer. Do not press enter there, but change the directory from Zend to Zend2 (or anything else). Press Enter in all subsequent questions.

7. Now Zend Optimizer will make some changes in your system. You need to know these changes. Here is what it did to my VPS:



The following configuration changes have been made:
- The php.ini file has been relocated from /usr/local/lib/../../lib to /usr/local/Zend2/etc.
- A symbolic link for the php.ini file has been created in /usr/local/lib/../../lib.
- The original php.ini was backed up to /usr/local/lib/../../lib/php.ini-zend_optimizer.bak


In my understanding, it just moved php.ini to Zend Optimizer's directory. It then created a symbolic link for the old php.ini.

8. Unfortunately PHP will enter safe mode and you will be unable to exit from it if you don't uninstall and reinstall it via Site Manager. Just go to your Site Manager in Site Applications and then in Development. Uninstall PHP 4.3.10 and reinstall it. Then return to SSH.

9. Copy Zend Optimizer's php.ini to /usr/lib/php.ini. Type this command: "cp /usr/local/Zend2/etc/php.ini /usr/lib/php.ini" and then Yes.

10. Now you have PHP 4.3.10 with Zend Optimizer 2.5.7. To test it, write an html file with the phpinfo() php command or use Site Manager. If you see the following, it is successfully installed:



This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies with Zend Extension Manager v1.0.6, Copyright (c) 2003-2004, by Zend Technologies with Zend Optimizer v2.5.7, Copyright (c) 1998-2004, by Zend Technologies


Note that Zend is a company and Zend Engine is not the same as the Zend Optimizer.

It should also say somewhere that safe mode is off.

You can copy this small guide and use it as public domain.

I thank Blender, Burk and Armadillo for providing their knowledge in other messages in the forum.

wildjokerdesign
02-22-2005, 09:08 PM
Thank you nsc.

jalal
02-23-2005, 02:05 AM
Thanx nsc.
One thing I don't understand, in point 8, you shouldn't need to reinstall PHP, all you need to do is edit the php.ini file, set safe mode off and then restart Apache. And in point 9, having 2 php.ini files seems like a bad idea to me, couldn't you just continue using a sym link?

Still if it works, it works... :)

nsc
02-23-2005, 08:06 AM
I tried editing php.ini but it didn't work. Yes, I agree that having two php.inis is a bad idea, but I encountered this problem: when I do "pico php.ini" in the directory which contains a php.ini symlink to the Zend's php.ini, the editor thinks I want to create a new file. I don't know why it happens. Another message in this forum indicated to copy the php.ini, so I decided that would be better because it allows you to edit php.ini easily with pico on ssh.

jalal
02-23-2005, 08:43 AM
You should be able to edit the file by using:
pico /usr/local/Zend2/etc/php.ini

instead of editing the symlink.

fuoss
12-18-2006, 11:40 AM
This same process worked perfectly for upgrading to PHP 5.1.2 with Zend Optimizer v3.2.0.

This allowed me to install Lightbox Photo Gallery.

I opted to have php.ini located in the Zend2 folder and set up a symlink at /usr/lib/php.ini

jefbear
01-12-2007, 05:24 PM
Hello...

I am trying to install (or upgrade) my Zend but I get an error:

sh: ./install.sh: bad interpreter: Permission denied


Any helpful ideas? :)


Jeff

wildjokerdesign
01-13-2007, 07:50 AM
Did you first install the GNU Compiler via your Site Manager?
http://www.helpdocs.westserver.net/sitemanager/SA_GNU_Compiler.htm