How to Fix PHP Fatal error after installing Zend or ionCube Loader
Sometimes when you have both Zend Optimizer and the ionCube loader installed on your system apache can break the first time you try and run it.
This is typically becuase the two installers do not play nice together and dont know about the other one. The fix is very easy and take little to no time.
In this article I am using PHP 5.2.x and Zend 3.3.0 on Red Hat Enterprise 4
Instructions
-
-
1
First, make sure that this is only listed once in the output
grep 'zend_extension.*ioncube' /etc/php.ini /etc/php.d/* -
2
Even with it only returning one result, this can still be broken.
So now what you need to do is to fix the loading order in php.ini
-
-
3
First, get rid of the file that had the line originally. In this example I just move the file in case you ever need it again, but you can also delete it if you prefer.
Code:
mv /etc/php.d/ioncube.ini ~ -
4
Now edit php.ini
Code:
nano -w /usr/local/Zend/etc/php.ini -
5
Edit the end of the file - the [ZEND] section - to look like the following (assuming you have both Zend Optimizer and ionCube installed)
if it does not look like this, change it to be so using correct file paths and versions.
[Zend]
zend_extension=/usr/lib/php/ioncube/ioncube_loader_lin_5.2.so
zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.3.0
zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.0
zend_optimizer.version=3.3.0
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so -
6
Restart Apache
Code:
/sbin/service httpd restart -
7
Verify output by using the php CLI from an SSH prompt.
Code:
php -vYou should see output that is similar to matching the following text
PHP 5.2.3 (cli) (built: Jun 7 2007 08:59:02)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with the ionCube PHP Loader v3.1.31, Copyright (c) 2002-2007, by ionCube Ltd., and
with Zend Extension Manager v1.2.0, Copyright (c) 2003-2007, by Zend Technologies
with Zend Optimizer v3.3.0, Copyright (c) 1998-2007, by Zend Technologies
-
1
Tips & Warnings
We are assuming RHEL 4, Zend Optimizer 3.3.0, PHP5 and ionCube are all used
If step 7 fails, it will tell you why in the output. The "why" is then what you need to fix.