Find the answer to your Linux question:
Results 1 to 4 of 4
Very glad to write post in this forum again. This afternoon, I downloaded xdebug (a PHP debugger) source and compile it, then I got a "xdebug.so". But when I add ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2013
    Location
    The city of Beijing
    Posts
    12

    Question xdebug.so: wrong ELF class: ELFCLASS64


    Very glad to write post in this forum again. This afternoon, I downloaded xdebug (a PHP debugger) source and compile it, then I got a "xdebug.so". But when I add this "xdebug.so" to my lampp, it prompt as this:
    Code:
    Failed loading /opt/lampp/lib/php/extensions/xdebug.so:  /opt/lampp/lib/php/extensions/xdebug.so: wrong ELF class: ELFCLASS64
    I guess the reason is that my machine is a 64bit cent-os and the lampp is 32bit and I complied the "xdbug.so" in a 64bit way. If this is the reason, then how can I compile the "xdebug.so" in a 32bit way? Set some env vars or pass some parameters to ./configure before make?
    I am a PHP programmer and do not understand the mechanism of the shared libs. I googled this problem but it helps little. And more, I am located in the China mainland, June the 4th is somewhat very terrible for the Greate Fire Wall, many web page with the key word "64" is blocked by the Greate Fire Wall when I use google.
    Thanks a lot!

    -------------------------------------
    I then got a "xdebug.so" that works in a web page titled "Komodo Remote Debugging Package Downloads". But I still want to know how to compile a shared lib in 32bit way in a 64bit machine.
    Last edited by cmpltrtok; 06-20-2013 at 08:51 AM.

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,508
    You can build a 32-bit component by setting the option -m32 in the CFLAGS Makefile variable. If the tool support the configure script, you should be able to set it when you run ./configure. Look at "./configure --help".
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    May 2013
    Location
    The city of Beijing
    Posts
    12
    Thank you for offering help, Rubberman.
    I followed your suggest and it works. But I am not certain if what I did is right, and there are some confusions too.
    I did these steps:
    1st,
    Code:
    make clean
    2nd,
    Code:
    export $CFLAGS=-m32
    3rd,
    Code:
    ./configure --enable-xdebug --with-php-config=/the/path/to/php-config/on/my/machine
    4th,
    Code:
    make
    I got 2 files then:
    Code:
    -rw-r--r--. 1 root root    805 6月  22 10:37 xdebug.la
    -rwxr-xr-x. 1 root root 236504 6月  22 10:37 xdebug.so
    I formerly got a copy of xdebug.so from a web page titled "Komodo Remote Debugging Package Downloads", but it is like below:
    Code:
    -rwxr-xr-x. 1 peter peter 604422 5月   4 00:31 xdebug.so
    Evidently they are different, I guess they may diff in version or other things.
    The question is:
    Is there any command to see informations in a *.so file if I only have the *.so file.

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,508
    The .so file is the shared library. Here is a link to a discussion thread about .la libraries (used by libtool to create .so files): linux - What is libtool's .la file for? - Stack Overflow
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •