7

When i am 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

Hamed Ghadirian
  • 6,159
  • 7
  • 48
  • 67
Umar Farooque Khan
  • 515
  • 1
  • 6
  • 17

4 Answers4

6

From the error message itself its clear what is the error. Please do some research before posting on StackOverflow.

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:

zend_extension=/usr/lib/ioncube/php_ioncube_loader_lin_X.X.so

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 (and if it does, just rename the ini file or add numerical prefix i.e. 50-ioncube.ini.

Finally, make sure that ionCube loader 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

https://mediatemple.net/community/products/dv/204404974/resolve-apache-error:-%22php-fatal-error:-%5Bioncube-loader%5D%22

Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141
Hari Swaminathan
  • 616
  • 1
  • 13
  • 27
  • If you use ubuntu `phpenmod ioncube` or similar to enable the module, then double check the symlink order in `/etc/php/7.4/fpm/conf.d` and others. `10-opcache.ini` get higher priority than `20-ioncube.ini` causing this issue. ioncube better be at the top – Dilhan Maduranga Oct 29 '20 at 00:17
6

Came to this thread when looking for this error, as @Hari Swaminathan said.

If extensions are loaded from /etc/php.d, they are loaded in alphabetical order

I got the error on a docker setup. So naming ini file like 00-ioncube.ini solved the problem

davidmpaz
  • 1,194
  • 15
  • 18
1

This error occurs because of an incorrect extension order in PHP configuration. Read this website may help you. You must load ioncube with higher priority.

Hamed Ghadirian
  • 6,159
  • 7
  • 48
  • 67
0

Had the same issue on a docker local development

Was able to ADD a ioncube specific ini file and module file

# Add ioncube
ADD etc/ioncube_loader_lin_7.2.so $PHP_EXT_DIR/ioncube_loader_lin_7.2.so

# Add php overrides
ADD etc/docker-php-ext-ioncube.ini $PHP_INI_DIR/conf.d/docker-php-ext-ioncube.ini

Thanks @davidmpaz