domingo, 16 de septiembre de 2012

Install XDebug in Linux Mint

Xdebug is a open source tool that allows debug our php applications, I use it a lot with Netbeans.
The current version is 2.2.1 and I will show you how install and use it.


UPDATE:
I don't know why,  but i had problems with a new installation on ubuntu. The solution was use:
sudo aptitude install php5-xdebug
and
sudo nano /etc/php5/conf.d/xdebug.ini

add the follow:
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000

then restart apache with:
sudo /etc/inid.d/apache2 restart

And it should works



* OLD METHOD

Xdebug needs two modules to compile: php5-dev and php-pear.
We will use apt-get to install these modules:

sudo apt-get install php5-dev php-pear

Now, we can download and install Xdebug:

sudo pecl install xdebug
(When xdebug finishes to install it shows us the path where is xdebug.so, copy it)

Then, we must configure Xdebug in php.ini to it works.

sudo nano /etc/php5/apache2/php.ini

and add this lines on the end:

zend_extension=/usr/lib/php5/<DATE+lfs>/xdebug.so
xdebug.remote_enable=on

Where <DATE+lfs> is the name of the folder that I mentioned previously on the xdebug installation.

Notes:
If you couldn't copy the xdebug.so path go to: /usr/lib/php5/ and search the folder where its name is like this: /20090626+lfs/
The +lfs in the name is always.





No hay comentarios:

Publicar un comentario