XDebug Install with XAMPP on Ubuntu

February 18th, 2009 by Nilesh § 10

Friends this will cover Xdebug installation in 2 different way, you can choose as per your need

1.) Install XDebug for use with XAMPP on Ubuntu Linux.

2.) Install xDebug by apt-get install way.

Install XDebug for use with XAMPP on Ubuntu Linux.

Lets assume you have XAMPP installed with developer source code and header of XAMPP. If you don’t have XAMPP developer package installed you can install it by following…

Build Environment Setup

XDebug will need to be compiled. A couple of packages need to be in place before you can build the source.

1. Install the build-essential package to setup a basic build environment:

sudo apt-get update
sudo apt-get install build-essential

2. Download the development archive for your version of XAMPP and extract it over your existing installation (you may want to backup your XAMPP directory first):

sudo tar xvfz xampp-linux-devel-1.6.8a.tar.gz -C /opt

Build XDebug

wget http://www.xdebug.org/files/xdebug-2.0.3.tgz

tar xzf xdebug-2.0.3.tgz

cd xdebug-2.0.3/

phpize

After this you will have following output on your console…

Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20060613
Zend Extension Api No:   220060519
./configure

make

sudo make install

Then the output will be this.. please monitor the directory specified.

Installing shared extensions:     /opt/lampp/lib/php/extensions/no-debug-non-zts-20060613/

After the Xdebug extension is installed, you’re ready to enable and configure the extension.

First create a folder in your temp folder that will holds the data file generated by Xdebug

sudo mkdir /opt/lampp/tmp/xdebug

sudo chmod a+rwx -R /opt/lampp/tmp/xdebug

Open php.ini in a text editor, and add the following lines at the end.
( generally you will find it in /opt/lampp/etc/ )

;xDebug Configuration starts

zend_extension = /opt/lampp/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so

xdebug.profiler_output_dir = "/tmp/xdebug/"
xdebug.profiler_enable = On
xdebug.remote_enable=On
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"

;xDebug Configuration ends

After adding the lines and verifying that your output directory is writable, restart your XAMPP server.

you can do it by  sudo /opt/lampp/lampp restart

and thats it..!! you have xDebug server running with apache..

Install xDebug by apt-get install way.

sudo apt-get install php5-xdebug

edit your php.ini file

In the end of the file, just add

xdebug.remote_enable=On
xdebug.remote_host=”localhost”
xdebug.remote_port=9000
xdebug.remote_handler=”dbgp”

If you are developing from another computer, we need to specify that ip address under xdebug.remote_host.

restart the server

sudo /opt/lampp/lampp restart

Tagged: , , ,

§ 10 Responses to “XDebug Install with XAMPP on Ubuntu”

  • Erdosam says:

    Hi,

    I’m a newbie on linux.. I’ve got a problem, when i “phpize”, i have this result

    Configuring for:
    PHP Api Version: 20041225
    Zend Module Api No: 20060613
    Zend Extension Api No: 220060519
    Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF
    environment variable is set correctly and then rerun this script.

    Then, i can’t “./configure”.. Please, help :(

  • Nilesh says:

    @Erdosam

    Hi Erdosam,

    I think its due to 2 reasons
    – either ‘autoconf’ is not installed or ‘phpize’ is not properly configured.

    you can try following..

    try determining if ‘autoconf’ is installed

    by just running
    $ autoconf

    or

    $ /opt/bin/autoconf

    if it’s not there then you will need to install the tool first, you can do it by,

    sudo apt-get install autoconf

    and then try to set $PHP_AUTOCONF with

    export PHP_AUTOCONF=/opt/bin/autoconf
    or
    export PHP_AUTOCONF=/opt/bin/

    You may also check if there is any new install of php5 on system
    then it might be in
    /usr/local/php5/bin/

    if so, then try using /usr/local/php5/bin/phpize instead of phpize

    Hope this will help,

    and please always include the system information to get much help.
    like OS type, server version, php version etc etc..

  • Erdosam says:

    Thanks, Nilesh

    It works now :)

  • Si says:

    Is there a way to sudo apt-get the whole thing? I remember I did it before, but I can’t now.

  • Eunikorn says:

    Really helpful … thank you a lot :D
    thanx to erdosam as well … i was getting the same error
    Its all fixed up now

  • Hi, I do not normally put up comments on blogs, as I like to learn only. However I discover the article that you’ve got written earlier has very insightful data, and I find it very informational. Anyway, I’m questioning whether you might be open for hyperlink trade, as I hope that we can agree on a mutual link alternate agreement. Hope to hear a constructive reply from you, and have a great day!

  • Carla Osawa says:

    Top-notch post indeed. My girlfriend has been waiting for this information.

  • [...] XDebug Install with XAMPP on Ubuntu このカテゴリの最新記事CodeIgniterでPHP Simple HTML DOM Parserを使う – July 7th, 2011PHP開発環境の構築 – July 5th, 2011 [...]

  • [...] XDebug Install with XAMPP on Ubuntu このカテゴリでの最新5記事CodeIgniterでPHP Simple HTML DOM Parserを使う – August 23rd, 2011CodeigniterのURLからindex.phpを削除する – August 23rd, 2011Amazon Product Advertising API にてitem_lookupした結果 – August 23rd, 2011file_get_contentsのHTTPエラーコードを調べる – August 23rd, 2011 [...]

  • Zhandos says:

    Thank you for great and simple article! :-)

  • § Leave a Reply

What's this?

You are currently reading XDebug Install with XAMPP on Ubuntu at Digicorp.

meta

Share