Hello Everyone! I'm having trouble getting Zend Optimizer to work with Apache If I do a php -v it shows optimizer installed, but a phpinfo.php doesn't. I would think that meant that the cli and apache were using different php.ini files, but according to the phpinfo they are both using the same one. I've downloaded the latest version from the Zend website, extracted it, copied the .so to the appropriate directory, added the lines to /etc/php.ini. Has anyone else ran into this problem? Any ideas on how to troubleshoot/resolve this? Thanks! Tfunk
I've tried a few things, a few different ways. I've tried the installer that came with version 3.3.3, I've tried the installer for 3.3.4 (which had some problems), and now I'm trying 3.3.9. On 3.3.9 I tried the installer that came with Zend. When that script didn't work, I removed php, et at and removed /etc/php.ini and /usr/Zend so I can a clear start again. This is what I did to install: 1. mkdir /usr/local/Zend/Optimizer 2. cp -rfv /home/username/ZendOptimizer-3.3.9-linux-glibc23-i386/data/5_1_x_comp/ZendOptimizer.so /usr/local/Zend/Optimizer 3. added this line to /etc/php.ini zend_extension=/usr/local/Zend/ZendOptimizer.so What is odd in my mind... Code: [root@server1 ~]# php -v PHP 5.1.6 (cli) (built: Apr 7 2009 08:00:04) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies [root@server1 ~]# Judging by the above output it appears that PHP itself knows that zend is loaded...but it shows 3.3.3 (maybe that's not a big deal)... running phpinfo from the CLI shows that the cli-php is using /etc/php.ini as the php.ini file. Code: [root@server1 ~]# php /www/domain.com/htdocs/ppi.php | grep php.ini Configuration File (php.ini) Path => /etc/php.ini [root@server1 ~]# so...The cli php is using /etc/php.ini as it's config. As shown below it's running Zend just fine... Code: [root@server1 ~]# php /www/domain.com/htdocs/ppi.php | grep Optimizer with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies Zend Optimizer [root@server1 ~]# Now, if I do the same through the web browser I see that it's using /etc/php.ini so it's not using a different/broken php.ini. Code: Configuration File (php.ini) Path /etc/php.ini but it doesn't show Optimizer running: Code: This program makes use of the Zend Scripting Language Engine: Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies Additionally, the script that I'm trying to run that requires Optimizer is complaining that it's not installed. It almost seems like the virtual host just isn't running the Optimizer. Also, for what it's worth. I tried disabling selinux in case it was the cause of the problem, but the same problem occurred.
Code: [root@server1 ~]# updatedb [root@server1 ~]# locate ZendOptimizer /home/Username/ZendOptimizer-3.3.4-linux-glibc23-i386.tar.gz /home/Username/ZendOptimizer-3.3.9-linux-glibc23-i386 /home/Username/ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz /home/Username/ZendOptimizer-3.3.9-linux-glibc23-i386/EULA-ZendOptimizer /home/Username/ZendOptimizer-3.3.9-linux-glibc23-i386/Inventory.xml /home/Username/ZendOptimizer-3.3.9-linux-glibc23-i386/LICENSE /home/Username/ZendOptimizer-3.3.9-linux-glibc23-i386/README-ZendOptimizer /home/Username/ZendOptimizer-3.3.9-linux-glibc23-i386/data /home/Username/ZendOptimizer-3.3.9-linux-glibc23-i386/md5 /home/Username/ZendOptimizer-3.3.9-linux-glibc23-i386/data/4_2_0_comp /home/Username/ZendOptimizer-3.3.9-linux-glibc23-i386/data/4_2_x_comp /home/Username/ZendOptimizer-3.3.9-linux-glibc23-i386/data/4_3_x_comp /home/Username/ZendOptimizer-3.3.9-linux-glibc23-i386/data/4_4_x_comp /home/Username/ZendOptimizer-3.3.9-linux-glibc23-i386/data/5_0_x_comp /home/Username/ZendOptimizer-3.3.9-linux-glibc23-i386/data/5_1_x_comp /home/Username/ZendOptimizer-3.3.9-linux-glibc23-i386/data/5_2_x_comp /home/Username/ZendOptimizer-3.3.9-linux-glibc23-i386/data/poweredbyoptimizer.gif /home/Username/ZendOptimizer-3.3.9-linux-glibc23-i386/data/4_2_0_comp/ZendOptimizer.so /home/Username/ZendOptimizer-3.3.9-linux-glibc23-i386/data/4_2_x_comp/ZendOptimizer.so /home/Username/ZendOptimizer-3.3.9-linux-glibc23-i386/data/4_3_x_comp/ZendOptimizer.so /home/Username/ZendOptimizer-3.3.9-linux-glibc23-i386/data/4_4_x_comp/ZendOptimizer.so /home/Username/ZendOptimizer-3.3.9-linux-glibc23-i386/data/5_0_x_comp/ZendOptimizer.so /home/Username/ZendOptimizer-3.3.9-linux-glibc23-i386/data/5_1_x_comp/ZendOptimizer.so /home/Username/ZendOptimizer-3.3.9-linux-glibc23-i386/data/5_2_x_comp/ZendOptimizer.so /usr/local/Zend/ZendOptimizer.so [root@server1 ~]# [root@server1 ~]# uname -a Linux server1.domain.com 2.6.18-128.7.1.el5 #1 SMP Mon Aug 24 08:20:55 EDT 2009 i686 athlon i386 GNU/Linux [root@server1 ~]#
SOLVED. After messing around with this for DAYS here is the solution. SELinux was interfering with Apache's attempt to access the .so file. When I disabled SElinux I thought that restarting apache would take care of it...I didn't realize you have to reboot. So, thought I had disabled SELinux to make sure it wasn't interfering with Apache...it was STILL running and STILL interfering with Apache because I didn't reboot. For anyone else who has this issue, you need to do the following, then reboot. Code: chcon -t texrel_shlib_t /usr/local/Zend/ZendOptimizer.so Code: execstack -c /usr/local/Zend/ZendOptimizer.so Hope this helps someone else down the road. Thanks for helping me Falko! You're the best!