Apache stuck with working after Xdebug was installed. Ioncube loader error
Asked Answered
M

2

5

I have a local installation of Ubuntu Server 12.10 via VirtualBox for my PHP programming purposes.

Recently I've installed the Xdebug in this way:

sudo apt-get install php5-xdebug

Then added 'xdebug' path to my /etc/php5/apache2/php.ini:

zend_extension=/usr/lib/php5/20100525+lfs/xdebug.so

Then I restarted apache. And, it got stuck. My local sites are not loading. The 'php -v' (as well as 'php -m') says:

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

Thing is that I don't have Ioncube installed. I tried to google this error-mesage, but everywhere said that it seems a wrong installed Ioncube, or something with xdebug and ioncube incompatibility. But I dont have inocube installed at all!

What is wrong? How can I make my apache live again? Projects are burning :(

UPDATE:

I've found a reason. It seems that 'php5-xdebug' package has a built-in fix for the ioncube-xdebug incompatibility. When I installed it, I got the file /etc/php5/conf.d/ioncube.ini where ioncube included as zend extension. I got this file with the php5-xdebug package. So I removed that file and apache became live.

Machute answered 11/2, 2013 at 19:19 Comment(3)
I don't have a full answer for you, but I would say that you shouldn't need to edit php.ini to enable xdebug. Installing the package should have added an xdebug file in /etc/php5/conf.d/ which includes the extension line. If you have both that might cause issues, so you could try removing the line you added to php.ini.Hermineherminia
You could also try disabling xdebug, and assming PHP then starts up okay, check phpinfo to see if there's anything ioncube related.Hermineherminia
Thank you, Tim. I sorted this out.Machute
H
12

Ioncube must be loaded before any other extension, so to fix this problem do this:

  1. goto /etc/php5/conf.d
  2. type mv ioncube.ini 01-ioncube.ini
  3. restart apache service apache2 restart
  4. Enjoy with ioncube and xdebug :)
Hunchback answered 16/10, 2013 at 16:45 Comment(3)
thank you so much. the solution for me was slightly varied, with just moving the 1 line in /etc/php5/conf.d/*-ioncube.ini into the PHP config file (for me, it was @ /etc/php5/fpm/php.ini). Then restarting apache/nginx (for me, it was nginx, so the command was "sudo service nginx restart").Timeconsuming
The ioncube installer script auto generates an ini file prefixed by 20-. For me this failed because it was getting loaded after another extension opcache which has symlink 05-opcache.ini. changed name to 05-ioncube.ini and all is good.Mantellone
ioncube is stupid. Changing it to 01-ioncube.ini from 20-ioncube.ini worked in the /etc/php5/apache2/conf.dCoroneted
T
3

Comment ioncube loader in the includes foldes of apache installation and move it to extensions block in php.ini so it would look like this:

    zend_extension = /usr/lib/php5/20090626+lfs/ioncube_loader_lin_5.3.so
    zend_extension = /usr/lib/php5/20090626+lfs/xdebug.so

Basically you must load ioncube first and only then xdebug.

Tbilisi answered 12/11, 2013 at 11:45 Comment(1)
can you know what's the reason for add lib in this order?Club

© 2022 - 2024 — McMap. All rights reserved.