Recently I upgraded PHP 5.2 to PHP 5.3 on a CentOS Linux server because of a PHP 0day and noticed an error complaining about ZendOptimizer-5.3.so which is the library loaded into PHP. After some research I found out that it doesn’t look like Zend Optimizer is available for PHP 5.3 on CentOS Linux and will not be available for PHP 5.3 period. Not a big deal in my scenario as I was using it as well as PHP eAccelerator. This error is easily resolved as long as you do not require the php-zend-optimizer package so if that is the case follow the directions below to resolve the error.
Apache Error Logs Complaining About ZendOptimizer-5.3.so:
- Failed loading /usr/lib/php/zend/ZendOptimizer-5.3.so: /usr/lib/php/zend/ZendOptimizer-5.3.so: cannot open shared object file: No such file or directory
- Failed loading /usr/lib/php/zend/ZendOptimizer-5.3.so: /usr/lib/php/zend/ZendOptimizer-5.3.so: cannot open shared object file: No such file or directory
- Failed loading /usr/lib/php/zend/ZendOptimizer-5.3.so: /usr/lib/php/zend/ZendOptimizer-5.3.so: cannot open shared object file: No such file or directory
When looking in the /usr/lib/php/zend/ directory there were numerous other ZendOptimizer .so files which are shown in the below example output.
ZendOptimizer .SO Library Files Available:
- [root@dev ~]# locate ZendOptimi
- /usr/lib/php/zend/ZendOptimizer-4.3.so
- /usr/lib/php/zend/ZendOptimizer-4.4.so
- /usr/lib/php/zend/ZendOptimizer-5.0.so
- /usr/lib/php/zend/ZendOptimizer-5.1.so
- /usr/lib/php/zend/ZendOptimizer-5.2.so
- [root@dev ~]#
As you can see there are numerous versions available except for the ZendOptimizer-5.3.so version we need. To resolve the issue remove php-zend-optimizer and restart Apache as shown in the below example.
Display & Remove php-zend-optimizer Using Yum On A CentOS Linux Server:
- [root@dev ~]# yum --enablerepo=atomic-testing list *ZEND*
- Loaded plugins: fastestmirror
- Loading mirror speeds from cached hostfile
- * addons: mirror.ubiquityservers.com
- * atomic: www4.atomicorp.com
- * atomic-testing: www4.atomicorp.com
- * base: dist1.800hosting.com
- * epel: mirrors.tummy.com
- * extras: styx.biochem.wfubmc.edu
- * rpmforge: ftp-stud.fht-esslingen.de
- * updates: mirror.raystedman.net
- atomic-testing | 1.9 kB 00:00
- Installed Packages
- php-zend-optimizer.i386 1:3.3.9-2.el5.art installed
- [root@dev ~]#
- [root@dev ~]# yum remove php-zend-optimizer
- Loaded plugins: fastestmirror
- Setting up Remove Process
- Resolving Dependencies
- --> Running transaction check
- ---> Package php-zend-optimizer.i386 1:3.3.9-2.el5.art set to be erased
- --> Finished Dependency Resolution
- Dependencies Resolved
- ====================================================================================================================================
- Package Arch Version Repository Size
- ====================================================================================================================================
- Removing:
- php-zend-optimizer i386 1:3.3.9-2.el5.art installed 5.7 M
- Transaction Summary
- ====================================================================================================================================
- Remove 1 Package(s)
- Reinstall 0 Package(s)
- Downgrade 0 Package(s)
- Is this ok [y/N]: y
- Downloading Packages:
- Running rpm_check_debug
- Running Transaction Test
- Finished Transaction Test
- Transaction Test Succeeded
- Running Transaction
- Erasing : php-zend-optimizer 1/1
- Removed:
- php-zend-optimizer.i386 1:3.3.9-2.el5.art
- Complete!
- [root@dev ~]#
Once removed restart Apache using the httpd init.d script. Once Apache is restarted you can verify that Zend Optimizer has been removed by checking your PHP version as shown in the below example.
Verify PHP Version On Linux Server:
- [root@dev ~]# php -v
- PHP 5.3.5 (cli) (built: Dec 29 2010 19:01:17)
- Copyright (c) 1997-2010 The PHP Group
- Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
- with eAccelerator v0.9.6.1, Copyright (c) 2004-2010 eAccelerator, by eAccelerator
- with the ionCube PHP Loader v3.3.20, Copyright (c) 2002-2010, by ionCube Ltd.
- [root@dev ~]#
You should no longer receive the error. If you require PHP Zend Optimizer then you will likely need to build it from source are stay on PHP 5.2. I would recommend not staying with PHP 5.2 and finding another solution because of all of the security holes with PHP 5.2.X.
Exactly what I was looking for. Thanks a million!
Hello Ali,
No problem. Thanks for taking the time to leave feedback.
Thanks.
alex
Thanks this saved me a headache.
Hello Terry,
No problem at all. Thanks for posting feedback.
Thanks.
alex