PROBLEM
Getting following error after installation of Zend Optimizer on a Plesk server,
Quote:
[root@vps ~]# php -v
PHP Fatal error: [ionCube Loader] The Loader must appear as the first entry in the php.ini file in Unknown on line 0
[root@vps ~]#
|
CAUSE
This error occurs because of incorrect extensions order in PHP configuration.
RESOLUTION
Zend extensions can be loaded directly from /etc/php.ini file or included from /etc/php.d/ directory. In both ways they should be loaded in the right order.
If extensions are loaded from "/etc/php.ini"
Quote:
then 'ioncube' line like zend_extension=/usr/lib/ioncube/php_ioncube_loader_lin_X.X.so
in /etc/php.ini must appear before Zend configuration sections, that usually begins with [Zend]
|
If extensions are loaded from /etc/php.d,they are loaded in alphabetical order of files. Usually 'ioncube' file is named /etc/php.d/ioncube.ini and zend is /etc/php.d/zend.ini.
Quote:
zend.ini section looks like this,
[Zend]
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.0a
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so
|
then restart apache service
Quote:
|
/sbin/service httpd restart
|
verified output
Quote:
[root@vps ~]# php -v
PHP 5.1.6 (cli) (built: May 9 2007 11:29:06)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
with the ionCube PHP Loader v3.1.28, Copyright (c) 2002-2007, by ionCube Ltd., and
with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies
with Zend Optimizer v3.3.0, Copyright (c) 1998-2007, by Zend Technologies
[root@vps ~]#
|
Now everything works, and Zend is properly displayed in php.ini