Zend Optimizer on Cent5.3 problem

Discussion in 'Server Operation' started by tfunky, Aug 29, 2009.

  1. tfunky

    tfunky New Member

    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?


  2. falko

    falko Super Moderator ISPConfig Developer

    What exactly did you do to install ZendOptimizer? Did you restart Apache?
  3. tfunky

    tfunky New Member

    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

    What is odd in my mind...

    [[email protected] ~]# 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
    [[email protected] ~]#
    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.

    [[email protected] ~]# php /www/domain.com/htdocs/ppi.php | grep php.ini
    Configuration File (php.ini) Path => /etc/php.ini
    [[email protected] ~]#
    so...The cli php is using /etc/php.ini as it's config.
    As shown below it's running Zend just fine...
    [[email protected] ~]# php /www/domain.com/htdocs/ppi.php | grep Optimizer
        with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies
    Zend Optimizer
    [[email protected] ~]#
    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.

    Configuration File (php.ini) Path 	/etc/php.ini 
    but it doesn't show Optimizer running:

    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.
  4. falko

    falko Super Moderator ISPConfig Developer

    What are the outputs of
    locate ZendOptimizer
    uname -a
  5. tfunky

    tfunky New Member

    [[email protected] ~]# updatedb
    [[email protected] ~]# locate ZendOptimizer
    [[email protected] ~]#
    [[email protected] ~]# 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
    [[email protected] ~]#
  6. tfunky

    tfunky New Member


    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.

     chcon -t texrel_shlib_t /usr/local/Zend/ZendOptimizer.so
    execstack -c /usr/local/Zend/ZendOptimizer.so
    Hope this helps someone else down the road.

    Thanks for helping me Falko! You're the best!

Share This Page