Resolve Apache error: "PHP Fatal error: [ionCube Loader]"

  • Applies to: All DV
    • Difficulty: Medium
    • Time Needed: 20
    • Tools Required: SSH, root or sudo access, vi knowledge


When you are trying to start Apache, the following error appears in the Apache error log:

PHP Fatal error: [ionCube Loader] 
The Loader must appear as the first entry in the php.ini file in Unknown on line 0


This error occurs because your PHP extensions are loading in the wrong order in your PHP configuration.


Before you start, this article has the following dependencies:

The publishing of this information does not imply support of this article. This article is provided solely as a courtesy to our customers. Please take a moment to review the Statement of Support.


Zend extensions can be loaded directly from /etc/php.ini file or included from /etc/php.d/ directory.

In the following example, this ioncube line must appear before any Zend configuration sections. These sections usually begin with [Zend] so they should be easy to see:


If extensions are loaded from /etc/php.d, they are loaded in alphabetical order. Usually the ioncube file is named /etc/php.d/ioncube.ini and zend is /etc/php.d/zend.ini. In this scenario, it should not present a problem.

Finally, make sure that ioncube is loaded only once. The following command should only return one result:

grep 'zend_extension.*ioncube' /etc/php.ini /etc/php.d/* 

If you make any configuration changes, always be sure to restart Apache:

 /etc/init.d/httpd restart