invalid ELF header

Posted by drmjsommer on 2009-04-07 19:21

Hi,

I am setting up remote debugging for PHP 5 in Komoto, and am getting a "invalid ELF header" error when adding the following lines to my php.ini file:

; xdebug config for Linux and Mac OS X
zend_extension=/opt/lampp/htdocs/xdebug/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=192.168.1.150
xdebug.remote_port=9000
xdebug.idekey=1

My system:
* XAMPP for Linux 1.6.4 (PHP 5.2.4, Apache 2.2.6, etc.)
* Suse 10 Linux (the server)
* Komodo-PHPRemoteDebugging-5.1.1-27706-linux-x86/5.2/xdebug.so, copied to /opt/lampp/htdocs/xdebug/
* Komodo IDE, version 5.1.1, build 27706, platform win32-x86 (the client)

What could be causing the "invalid ELF header" error?

Thanks,
Martin

toddw
ActiveState Staff
Wed, 2009-04-08 07:57

Sounds like the wrong xdebug binary is being used.

You can retrieve the elf information through the file command:
file /opt/lampp/htdocs/xdebug/xdebug.so

Are you running a 64-bit Suse 10 OS, which likely means the php interpreter/apache are also 64-bit? If so try using the 64-bit xdebug package.

Cheers,
Todd

drmjsommer | Wed, 2009-04-08 10:22

Thanks Todd,

This isn't telling me much:

linux:/opt/lampp/htdocs/xdebug # file xdebug.so
xdebug.so: Mach-O fat file with 3 architectures

I doubled checked the download link, and even tried an earlier version.

Also, I am using 32-bit Suse 10.

Does the Mach-O info tell you anything?

Martin

troyt
ActiveState Staff
Wed, 2009-04-08 10:55

"Mach-O fat file with 3 architectures" tells you that it's
a Mac OS X universal binary. This won't work on Linux.

I just checked the package from the ASPN download page:

PHPRemoteDebugging-5.1.1-27706-linux-x86.tar.gz

Sure enough, it currently contains the wrong binaries. Sorry about that!

I'll raise a bug to get this fixed ASAP. In the meantime, use the
xdebug.so file that came with Komodo. Those *should* be the correct
ones:

<komodo-install-directory>/lib/support/php/debugging/<PHP-version>/

drmjsommer | Wed, 2009-04-08 11:31

Thanks again Troy,

Since I am setting up "remote" debugging, where the server is running Linux, and my client (Komodo) is running Windows, the Komodo download contains the wrong xdebug file. I need a xdebug.so, whereas the Komodo download contains a xdebug.dll.

Can you please give a place to download the correct xdebug.so file?

Martin

troyt
ActiveState Staff
Wed, 2009-04-08 13:07

I've attached the PHP 5.x Linux binaries to the bug report.

http://bugs.activestate.com/show_bug.cgi?id=82706

drmjsommer | Wed, 2009-04-08 15:03

Troy, thanks for the new file. I am now getting a "Floating point exception":

linux:/home/sommer # php -m
Floating point exception

Any ideas?

Thanks,
Martin

troyt
ActiveState Staff
Wed, 2009-04-08 15:20

Could you do a 'which php' to check if the XAMPP version is the one being used ('php -v' would also be useful).

Have you tried a 'phpinfo()' file with Apache?

drmjsommer | Tue, 2009-04-14 17:13

Thanks for your info on Suse 10 vs Komodo 5. I was able to download and get Komodo 4.4 remote-debugging working on Suse 10.

Please let me know, if this is fixed for Komodo 5.

Thanks,
Martin

troyt
ActiveState Staff
Thu, 2009-04-16 09:50

Some of this discussion happened in email, so I'll summarize in case anyone else is hitting this.

There's a known issue with Komodo 5 not running on Suse Enterprise Linux 10:

http://community.activestate.com/forum/cant-run-komodo-5

It seems the same problem applies to the remote debugging libraries. Using the Komodo 4.4 version seems to work. They're available for download here:

http://aspn.activestate.com/ASPN/Downloads/Komodo/RemoteDebugging