Help - Search - Members - Calendar
Full Version: HOW-TO: Zend Optimizer (On Ensim)
The Planet Forums > System Administration > HOWTOs
foggy
Installing Zend Optimizer

SSH into your server as 'root' user

#Make a backup of your php.ini before you proceed:

cp /etc/php.ini /etc/php.ini.backup

#Download the file. You need to create an account at zend.com before you can download this file. I used to have this file on my server, but that was ages ago....

http://www.zend.com/free_download/optimizer

tar zxvf ZendOptimizer.tar.gz

cd ZendOptimizer

./install

#You'll be asked the following questions, answer them with the following:

#Specify the location where to install Zend Optimizer:

/usr/local/Zend

#Confirm the location of your php.ini file:

/etc

#Are you using the Apache webserver?

Yes

#Specify the Apache configuration directory:

/etc/httpd/conf

#The install script should now detect the right Version of PHP.

Choose "Yes" to proceed.

#Specify the Apache bin directory:

/usr/sbin

#After that, your php.ini is automatically relocated to /usr/local/Zend/etc and a symlink is created.

#Do you want to restart Apache Webserver

Choose "No" (Iv had trouble with that script and it failed to restart apache, just restart apache manually)

#Restart Apache

service httpd restart

#Zend Optimizer is now installed..

To make Zend Optimizer available for sites in High Security mode on Ensim PRO, follow this which was posted by: Egoh

CODE
After normally installing Zend copy it to the high security site:

cp -r /usr/local/Zend/ /home/virtual/site#/fst/usr/local/Zend/



Now lets load it in:

pico -w /home/virtual/site#/fst/etc/php.ini



On the bottom paste this:



[Zend]

zend_optimizer.optimization_level=15

zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-2.1.0

zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-2.1.0

zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so

zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so







Save it and your done.

no apache restart needed.
Rickluke
It looks good!

Where is Zend good for? And isn't it already in PHP 4.3.1?
foggy
some programs, like ModernBill (i believe) need zend optimizer

more infomation on it @ http://zend.com/store/products/zend-optimizer.php
wirewolf
You really should point out that while Zend Optimizer will make the scripts execute faster it makes the parsing half of running the script slower, unless you are executing Zend Encoder encoded files. This will actually cause your scripts to be executed slower and add more load to your server. Zend Optimizer is best used with a PHP caching product, I'm guessing Zend Accelerator would be your best bet for compatibility, I'm not sure about the others. Take a look at this thread.

http://forum.rackshack.net/showthread.php?...&threadid=19188

Colby
webspace1
can this be used with turck mmcache?
benoitb
service httpd restart
Shutting down http: [FAILED]
Starting httpd: Processing config directory: /etc/appliance/apacheconf
Processing config file: /etc/appliance/apacheconf/apache
PHP Fatal error: [Zend Optimizer] Extension "Zend Optimizer" cannot be loaded twice in Unknown on line 0
[FAILED]

Any clues???
char
I believe Turck MMCache supports running alongside Zend Optimizer, but it disables the 'optimizing' aspect of it, as Zend products are closed source and there is no real way to make them 'truly' work together.

The only use for Zend Optimizer then is running Zend encoded scripts (like ModernBill, etc).
zapthis
Everything seems to of installed but still does not work I teird the High Security but I get the file is not found

I did this below and get this

cp -r /usr/local/Zend/home/virtual/site1/fst/usr/local
cp: missing destination file



To make Zend Optimizer available for sites in High Security mode on Ensim PRO, follow this which was posted by: Egoh



code:--------------------------------------------------------------------------------After normally installing Zend copy it to the high security site:
cp -r /usr/local/Zend/ /home/virtual/site#/fst/usr/local/Zend/

Now lets load it in:
pico -w /home/virtual/site#/etc/php.ini

On the bottom paste this:

[Zend]
zend_optimizer.optimization_level=15
zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-2.1.0
zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-2.1.0
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so



Save it and your done.
no apache restart needed.--------------------------------------------------------------------------------
zapthis
Doing high secuirty doesn't seem to work right I get this...


pico -w /home/virtual/site4/etc/php.ini

bash: pico: command not found

I have no idea what else I can do.
foggy
QUOTE
Originally posted by zapthis
Everything seems to of installed but still does not work I teird the High Security but I get the file is not found

I did this below and get this  

cp -r /usr/local/Zend/home/virtual/site1/fst/usr/local
cp: missing destination file


You're typing it wrong.

Theres a space after /Zend/ and /home.

cp -r /usr/local/Zend/ /home/virtual/site#/fst/usr/local/Zend/


and try this

pico -w /home/virtual/site4/fst/etc/php.ini


and make sure you are root (su -) that is "su -"
zapthis
QUOTE
Originally posted by foggy
You're typing it wrong.

Theres a space after /Zend/ and /home.

cp -r /usr/local/Zend/ /home/virtual/site#/fst/usr/local/Zend/


and try this

pico -w /home/virtual/site4/fst/etc/php.ini


and make sure you are root (su -) that is "su -"



Thanks Foggy for the help. I think pico is not installed. I still get the same messge when is use:

pico -w /home/virtual/site4/fst/etc/php.ini

bash: pico: command not found

How do you install pico?

Thanks again for the help!

Update: ok I installed pico , but whrer do I paste the zend info? Right at the very end of the file?

Update: all is good now, many thanks for all your help!
vtrac
...
vtrac
So how do I know if Zend is installed? My pages don't seem any faster.
LighthousePoint
QUOTE
Originally posted by vtrac
So how do I know if Zend is installed?  My pages don't seem any faster.


[php]phpinfo();
?>[/php]

That should return that you're using the Zend optimizer.
vtrac
I've got this:

QUOTE
This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright © 1998-2003 Zend Technologies


Is that the optimizer?
LighthousePoint
yep.
char
If you want your pages to execute faster, try using a PHP opcode cache like Turck MMCache or PHPAccelerator
foggy
QUOTE
Originally posted by LighthousePoint
yep.


nope.. you would see something like this

This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright © 1998-2003 Zend Technologies with Zend Optimizer v2.1.0, Copyright © 1998-2003, by Zend Technologies
Ronny
I'm getting this error too when installling Zend Optimiser after MMCache

PHP Fatal error: [Zend Optimizer] Extension "Zend Optimizer" cannot be loaded twice in Unknown on line 0
[FAILED]
Gary Simat
I am getting the same error as well.. Anyone have any ideas on how to fix this problem?
perldork
There appears to be a bug in the installer .. if you look in php.ini you will see

CODE
[Zend]

zend_optimizer.optimization_level=15

zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-2.5.1

zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-2.5.1

zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so

zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so

zend_extension_ts=/usr/local/Zend/lib/ZendOptimizer_TS.so

zend_extension=/usr/local/Zend/lib/ZendOptimizer.so


Duplicate zend_extension and zend_extension_ts lines .. the first two should be

CODE
zend_extension_manager=/usr/local/Zend/lib/ZendExtensionManager.so

zend_extension_manager_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so


Which makes the fixed config this:

CODE
[Zend]

zend_optimizer.optimization_level=15

zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-2.5.1

zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-2.5.1

zend_extension_manager=/usr/local/Zend/lib/ZendExtensionManager.so

zend_extension_manager_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so

zend_extension_ts=/usr/local/Zend/lib/ZendOptimizer_TS.so

zend_extension=/usr/local/Zend/lib/ZendOptimizer.so


that fixed the issue for me.
hyperbuzzy
Hi,

I've just installed Zend Optimizer 2.5.10 on my new Ensim Pro 4.0.3 box. It installed OK but does not show up when I'm looking at a phpinfo file.

Through the install it prompts for the apache control utility which is set to:

/usr/sbin/apachectl


any help would be great.

Thanks.
kamihacker
QUOTE (hyperbuzzy)
Hi,

I've just installed Zend Optimizer 2.5.10 on my new Ensim Pro 4.0.3 box. It installed OK but does not show up when I'm looking at a phpinfo file.

Through the install it prompts for the apache control utility which is set to:

/usr/sbin/apachectl


any help would be great.

Thanks.

I think it doesn't work for high security mode sites, although I could be wrong

try going down to 3.1 Ensim compatibility mode and try again

di you run system maintenance after that? that would help as well

regards
hyperbuzzy
What do you mean "system maintenence"?

I have uninstalled it and installed version 2.5.3 - installed and works without a problem.
gpan
You need a more recent PHP (4.3.9+ I believe) to use Zend 2.5.10. Also, you only need maintenance to propagate upgraded PHP to high security sites, but they don't use the global php.ini anyhow.
skillarchy
k i intall zend 2.5.10 on redhad running ensim

when view php info via browser i get

This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright © 1998-2004 Zend Technologies with Zend Extension Manager v1.0.8, Copyright © 2003-2005, by Zend Technologies



when run php -v i get
[root@box3 root]# php -v
PHP 4.4.0 (cgi) (built: Jul 12 2005 02:09:00)
Copyright © 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright © 1998-2004 Zend Technologies
with Zend Extension Manager v1.0.8, Copyright © 2003-2005, by Zend Technologies
with Zend Optimizer v2.5.10, Copyright © 1998-2005, by Zend Technologies
[root@box3 root]#


i even went as far as tried a few things and zend optimize scripts still not working


i ran ensim maintainance

i even tried it on a low security site


still now working


anyone with any idea what might be going on your help is mostly appreciated thanks in advance
BoTGoD
Great Guide.

I'm a linux newbie and it took me about 10min following this guide to get it installed without any errors.


I feel so proud. lol.

Thanks again.
jamx551
I have installed font viewer site that requires Zend Optimizer Installed..

My server admin says that the server has Zend Optimizer and I checked using the PHP info it was confirmed as displayed below :

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.1.0, Copyright © 1998-2006 Zend Technologies
with Zend Extension Manager v1.0.9, Copyright © 2003-2006, by Zend Technologies
with Zend Optimizer v2.6.2, Copyright © 1998-2006, by Zend Technologies


But why is it when I run : http://axillon.com/fonts/index.php

It says;

Zend Optimizer not installed

can anyone pls advise?

thanks in advance!

Jamx

___________________________
Hire power Coders/designers : Powerlance.com

Free photoshop/graphic tutorials : Photohopplanet.com

Order great Custom Logos : Axillon.com

Hire copywriters : Copywriter.Manigsaca.com
jamx551
Bump!
scruffylooking
This tutorial does not seem to cover the question you are asked about the path to the apachectl file.

As far as I can tell, it appears that this file is not located on my box. I am running RH 7, Ensim Pro 3.5.

Does anyone know where I can find this file or how I can get around installing Zen Optimizer without having to enter the path.

Zen does not need this file - so it should be optional. (I believe they added it for convenience sake - so you could stop and start the server through the installation process. Its proving to be very inconvenient though!)

Anyone?
Wolfe
I have the same problem. When I check via the php code is says Zend is installed. When I try to run my program which requires Zend, it also says ZEND NOT INSTALLED. Same as the fellow above.

Anyone have a fix for this?



QUOTE (jamx551)
I have installed font viewer site that requires Zend Optimizer Installed..

My server admin says that the server has Zend Optimizer and I checked using the PHP info it was confirmed as displayed below :  

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.1.0, Copyright © 1998-2006 Zend Technologies
   with Zend Extension Manager v1.0.9, Copyright © 2003-2006, by Zend Technologies
   with Zend Optimizer v2.6.2, Copyright © 1998-2006, by Zend Technologies

 
But why is it when I run : http://axillon.com/fonts/index.php  

It says;

Zend Optimizer not installed

can anyone pls advise?

thanks in advance!

Jamx

___________________________
Hire power Coders/designers : Powerlance.com

Free photoshop/graphic tutorials : Photohopplanet.com

Order great Custom Logos : Axillon.com

Hire copywriters : Copywriter.Manigsaca.com
Wolfe
I discovered a solution to ensim and Zend. This solution works for me on my ensim X box with centOS 4.4. It should work for other versions as well.

You need to make a symlink to Zend's php.ini file for each virtual site you want Zend installed on.

Use this code after you have followed the initial install instructions...

cd /home/virtual/sitex/fst/etc

cp php.ini php.ini.bak

rm -f php.ini

ln -s /etc/Zend/etc/php.ini php.ini

Now Zend will work with that virtual site. Same instructions for IP based site
alleluia
"The new PHP package does not store configuration directives from external (shared) PHP extensions in php.ini anymore. These directives will be stored in own extension-specific configuration files in the /etc/php/*/ext directories."

From gentoo doc.

If you still have problem with the loader not enabled in phpinfo then you should have a look in

cd /etc/php/apache2-phpx/ext

and find

ZendOptimizer.ini

edit it

nano -w ZendOptimizer.ini

and change to
zend_optimizer.optimization_level=1023
zend_optimizer.enable_loader=1
zend_optimizer.disable_licensing=0

That should do it icon_smile.gif
ntburchf
To get zend to install with all new sites --
http://onlinesupport.ensim.com/TWKB/ViewCa...UpdateUsage=yes
QUOTE
1.Download Zend Optimizer from www.zend.com and follow the installation procedure.
2.Once the installation is complete, create tar file using following command.
# tar cf virtDomain.tar /usr/local/Zend (Assuming that Zend has been installed at default location - /usr/local/Zend)
3.Copy this tarball to /etc/appliance/customization
4.Download the attached custom script named virtDomain.sh and upload the same to /etc/appliance/customization
5.Download the attached custom script named editVirtDomain.sh and upload the same to /etc/appliance/customization

Note : you need to replace Zend Extension part with one copied from /usr/local/Zend/etc/php.ini in the attached scripts.
6.chmod both script to 755

Now all new domain created on server with any security level will be Zend enabled. If you want existing domain with high security to be zend enabled then you just need to re-save the site from Webppliance.


virtDomain.sh
CODE
#!/bin/sh
DOMAIN=$1
echo "; Enable Zend Extensions
[Zend]
zend_optimizer.optimization_level=15
zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-2_6_0
zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-2_6_0
zend_optimizer.version=2.6.0
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so
" > /home/virtual/$DOMAIN/etc/php.d/zend.ini


editVirtDomain.sh
CODE
#!/bin/sh
#the site id is the first argument
siteid="$1"
tar xf /etc/appliance/customization/virtDomain.tar -C /home/virtual/$siteid/fst/
echo "; Enable Zend Extensions
[Zend]
zend_optimizer.optimization_level=15
zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-2_6_0
zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-2_6_0
zend_optimizer.version=2.6.0
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so
" > /home/virtual/$siteid/fst/etc/php.d/zend.ini
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.