XAMPP on Linux + Xdebug (Linux 64bit)

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

    You do not even need to talk about the crazy benefits of a debugger for PCPs. On 64-bit whist / windows7, the hdebag didn’t want to work at all (Vista collapsed; for the seven there was no compiled version of the library)

    For those who don’t know:
    XAMPP - a program package from apache + mysql + php + perl + proftpd + ...
    XDebug - a library for PHP Allows you to clean up crap scripts on PHP. (Mostly used in conjunction with an IDE, for example Eclipse + PDT. Allows you to set breakpoints, debug step by step and view the contents of variables)

    If you came here from a search, then you are not much interested in my adventures and searches, so 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 you use XAMPP for Linux for other reasons.
    * You need XDebug
    * You have 64-bit Linux
    * By the time you start reading this post, 64-bit HAMRR does not exist.

    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 to my problem, so I decided to share it with you here.


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

    Install XAMPP

    We go here, select the desired version

    In my case, this is XAMPP Linux / 1.7.1.

    We upload files (let's say in the ~ / Downloads / xampp / directory):
    * xampp-linux-devel - *. Tar .gz - contains the header files
    * xampp-linux - *. tar.gz required for compiling xdebug - XAMPP itself -

    Install the Xamp 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

    Here from here: xdebug.org/download.php
    deflate the source code for the required version (I deflated 2.1.0RC0 and 2.0.5). I downloaded at ~ / Downloads / xdebug /


    # tar xzf xdebug*

    # cd xdebug*

    Install other libraries

    Honestly, I don’t even know if they are really needed. But in order to compile FF for 32-bit out of 64 it seems as needed

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

    Configure environment variables

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

    * Open ~ / .bashrc
    * Finally, 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"

    Build 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

    Copy to the folder to Xamp

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

    Configure PHP

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

    Turn on the library (I added this on line 545)

    Start / restart and check

    # sudo /opt/lampp/lampp restart

    # /opt/lampp/bin/php -i | grep 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

    Also popular now: