In my previous post I wrote about how we install XAMMP in the home directory of a user. We often need to profile our code and often on a variety of setups, the answer of course is to use Xdebug.
Following is the procedure for installing PHP's 'xdebug' extension for XAMPP on linux (most of the installation procedure is same as http://www.xdebug.com/docs/install but there are a few quirks).
- First you have to install XAMPP development package (http://www.apachefriends.org/en/xampp-linux.html) for your XAMPP installation. This package provides the necessary source files needed to compile the extra stuff
- Download 'xdebug' source from http://www.xdebug.com/ , uncompress it in a suitable directory, cd to that directory.
- Now run phpize
CODE:
-
[amit@amit xdebug-2.0.0RC4]$ /opt/lampp/bin/phpize
-
- Configure the extension
CODE:
-
[amit@amit xdebug-2.0.0RC4]$ ./configure --enable-xdebug --with-php-config=/opt/lampp/bin/php-config
-
- Run 'make' to get the compiled xdebug.so
CODE:
-
[amit@amit xdebug-2.0.0RC4]$ make
-
- Copy the xdebug.so file to PHP's extensions directory (you may need root privileges for this)
CODE:
-
[root@amit xdebug-2.0.0RC4]# cp modules/xdebug.so /opt/lampp/lib/php/extensions
-
- After that edit php.ini file and add
CODE:
-
zend_extension=/opt/lampp/lib/php/extensions/xdebug.so
-
- Lastly restart XAMPP and check phpinfo for Xdebug extension
I can't think of what can possibly go wrong with the above setup instructions but if it does, put in a comment and I can try to help
xdebug-2.0.0RC4 only works for xampp with php5 (for me)
Has something to do with php header files.
I think that atm you can only compile xdbug agains a single php version.
Perhaps with some tweaking, symlinking etc, and a second xdebug config/compile it might be possible to have xdebug working for php4 and php5.
i ran into the same problem as shane, fixed it by downloading php sources (4.4.7) and extracting into the xampp include folder over the existing php folder. that gives you the correct version #s for phpize, and everything seems to work afterwards
I am using xdebug-2.0.0RC4 with xampp with php5 and followed the instructions except to avoid global alloc variable not found error I used zend_extensions_ts and phpinfo and php -m does not show xdebug. Any ideas?
Nice
Hi,
I dowloaded php_xdebug-2.0.2-4.4.6.dll and want to run it with XAMPP (basic package) version 1.6.3a
Another requirement is that I want to run XAMPP with PHP 4.
I followed the instructions at the xdebug site and also here but when I tried to start XAMPP it didnt.
Cannot implement Patrick's solution as I have made many changes to my PHP installation.
Any other way out on this?
Thanks in advance.
I hope configuring eclipse to use Xdebug will work, too.
great instructions!
i had to
sudo apt-get install autoconf
on Ubuntu, otherwise, you will get "Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF"
hello,
i've been using this, as well as some other tutorials i found explaining how to do this... with all pretty much saying the same thing. My problem is this: after copying xdebug.so to /opt/lampp/lib/php/extensions, editing my php.ini accordingly, and restarting my xampp install, i receive the following message:
Starting XAMPP for Linux 1.6.8a...
Failed loading /opt/lampp/lib/php/extensions/xdebug.so: /opt/lampp/lib/php/extensions/xdebug.so: wrong ELF class: ELFCLASS64
XAMPP: Starting Apache with SSL (and PHP5)...
XAMPP: Starting MySQL...
XAMPP: Starting ProFTPD...
XAMPP for Linux started.
i am using Ubuntu Hardy (8.04) amd64, xampp 1.6.8a, and xdebug 2.0.3. if you have any tips on why i am getting this error, or could point me in the right direction towards a solution, i would be very grateful
thank you for the post, and hopefully for your followup to this issue.
http://www.google.co.in/search?q=wrong+ELF+class%3A+ELFCLASS64 4th or 5th link
I did not know the answer to the problem till a few min ago
hey Tarique,
), but haven't found the solution just yet.
thanks for your quick reply... i'm assuming you mean the Ubuntu forums link... I've read all of the pages on the first page of results from that query you posted (which i had already used as a google query
i believe that what's happening is that my XAMPP stack is running at 32-bit, and my version of xdebug.so is being compiled as 64-bit since i'm running x86_64 ubuntu. this is causing the conflict.
i would like to compile xdebug as 32-bit... do you know if there's a flag i can pass to ./configure or somewhere else to achieve this? thanks again!!!
so, in the end, i just booted with the 32bit live cd of the same version of Ubuntu, compiled there, and copied the file over to my harddrive. now everything works.
@Francisco any chance you could share your precompiled 32bit xdebug.so? Thanks.
/@Tarique Sani could you send me Francisco email, please?/
i'd be happy too... but i can't do it here
if you give me an email address, i can send it to you.
@Tarique - if you want, i can email to you and you can post here?
@Francisco - as per his twitter think Nik solved the problem - you can post a URL in the comment anyways, will help someone else...
For those who need 32bit working builds of xdebug for Linux, MacOS X or Windows, ActiveState (the makers of the Komodo IDE) provide their pre-compiled binaries of xdebug they use in their IDE.
Just go to their site:
http://aspn.activestate.com/ASPN/Downloads/Komodo/RemoteDebugging
and get one
The packages contain builds for all php versions.
They always provide the lastest trunk build thoug. For the stable version (actualy 2.0.3) you'll still need to build your own binary.
Hope that help! Jonatas
Thanks a lot. Great instructions
Greetings!
I've been running into the ELFCLASS64 problem and can't figure out how pass a -m32 option to ./configure.
Would anyone be willing to share one of your 32 bit binaries? ... or share a hint on how to compile with the 32 bit option? Thanks a bunch in advance.
best howto i ever seen
thx