📜 ⬆️ ⬇️

XAMPP on Linux + Xdebug (Linux 64bit)

So, today I managed to put XDebug on XAMPP for Linux. If you have a 32-bit Linux, you can not read the remaining text, you have a simple solution, and not one that can be easily found on the Web.

About the insane benefits of debugger for PCP do not even need to tell. On 64-bit whist / vindous7, the hdebag did not want to work at all (whist collapsed; there was no compiled version of the library for the seven)

For those who do not know:
XAMPP - software package from apache + mysql + php + perl + proftpd + ...
XDebug is a library for PHP. Allows you to clear scripts on PHP. (Mainly used together with IDE, for example Eclipse + PDT. Allows you to set breakpoints, debug step by step and watch the contents of variables)
')
If you come here from a search, then you are not interested in my adventures and searches, therefore, immediately to the point.

Update: Dear future readers, this article is for you if:
* You often need to switch between different web server configurations (for example PHP4 / 5.2 / 5.3) or for other reasons you are using XAMPP under Linux.
* You need XDebug
* You have 64-bit Linux
* By the time you start reading this post there is no 64bit HAMRP.

The rest, you can not read. I do not compare HAMRR with other existing solutions, I just have it, I use it with pleasure. I rummaged in the network and did not find a solution for my problem, so I decided to share with you here.



System


Linux: Ubuntu 9.10 Karmic Koala 64bit
XAMPP: v1.7.1 (with PHP 5.2.9) - I think for another version the process will be very similar.

Installing XAMPP


Go here, choose the version you want.
sourceforge.net/projects/xampp/files

In my case, this is Linux XAMPP / 1.7.1.

We download files (for example, to the ~ / Downloads / xampp / directory):
* xampp-linux-devel - *. tar.gz - contains the header files needed for compiling xdebug
* xampp-linux - *. tar.gz - the XAMPP itself

Install Ksamp and libraries in the / opt folder

# cd ~/Downloads/xampp

# sudo tar xzf xampp-linux-1.7.1.tar.gz -C /opt

# sudo tar xzf xampp-linux-devel-1.7.1.tar.gz -C /opt


Download xdebug


From here: xdebug.org/download.php
we download the source code of the required version (I downloaded 2.1.0RC0 and 2.0.5). I downloaded in ~ / downloads / xdebug /

Unpacking

# tar xzf xdebug*

# cd xdebug*


Installing other libraries


Honestly, I do not even know if they really are needed. But in order to compile FF for 32-bit from 64, it seems to be necessary

# sudo apt-get install ia32-libs gcc-multilib

Configuring Environment Variables


For some reason, phpize flatly refused to work, complaining about $ PHP_AUTOCONFIG and $ PHP_AUTOHEADER without the following thing:

* Open ~ / .bashrc
* In the end we add the line:
export PATH=/opt/lampp/bin:$PATH

Now in the shell:

# export PATH=/opt/lampp/bin:$PATH

# export PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig

# export CC="gcc -m32"

# export CXX="g++ -m32"


We collect Xdebug for 32-bit


# phpize

# ./configure --enable-xdebug --with-php-conig=/opt/lampp/bin/php-config --x-libraries=/usr/lib --target=i686-pc-linux

# make


We copy in a folder to Ksamp

# sudo cp modules/xdebug.so /opt/lampp/lib/php/extensions/


Configuring PHP


# sudo gedit /opt/lampp/etc/php.ini

Turn on the library (I added this on line 545)
zend_extension="/opt/lampp/lib/php/extensions/xdebug.so"


Start / restart and check


# sudo /opt/lampp/lampp restart

# /opt/lampp/bin/php -i | grep xdebug

xdebug
xdebug support => enabled
xdebug.auto_trace => Off => Off
xdebug.collect_includes => On => On
xdebug.collect_params => 0 => 0
xdebug.collect_return => Off => Off
xdebug.collect_vars => Off => Off
xdebug.default_enable => On => On
xdebug.dump.COOKIE => no value => no value
xdebug.dump.ENV => no value => no value
...
..


Happy debugging!

PS: you can remove the added line from ~ / .bashrc

Source: https://habr.com/ru/post/91575/


All Articles