Can i use xdebug on ubuntu?

I am trying to debug some PHP code and want to download the XDebug debugger for PHP. All I see is to download Windows files. Is it even possible to use it on Ubuntu?

+48
php ubuntu xdebug
Mar 31 '11 at 17:54
source share
5 answers

Run the following commands in your terminal.

Download Xdebug - you will need to follow alternative instructions if you no longer have PHP5 running on your machine.

sudo apt-get install php5-xdebug 

The package should change your INI file for you, but just in case you need to edit it yourself and make the following changes: on Ubuntu, usually on / etc / php 5 / apache2 / php.ini - add the following line.

 zend_extension="/usr/lib/php5/20110331/xdebug.so" 

This path may be slightly different from your system - just make sure that it fully matches the path to the xdebug.so file on your computer. Also do not forget to comment on any links to Zend Debugger - you cannot run both at the same time.

Now restart Apache.

 sudo /etc/init.d/apache2 restart 

You may also need to enable html_errors. Locate html_errors in the file / etc / php 5 / apache2 / php.ini and make sure it is set to On. A restart of Apache is also required.

 html_errors = On 

Double check with phpinfo () to make sure everything is installed correctly - you can also configure Xdebug in the php.ini file.

+105
Mar 31 '11 at 18:02
source share
 sudo apt-get install php5-xdebug 
+20
Mar 31 '11 at 17:55
source share

On the newer Ubuntu (at least on 14.04 LTS) I also needed to activate the module. So overall I did:

 sudo apt-get install php5-xdebug sudo php5enmod xdebug 

After the server reboot, xdebug was available.

+13
Aug 30 '15 at 12:14
source share

This article helped me in Ubuntu 16.04 running PHP7:
Link to the article

 sudo apt-get install php-xdebug 
+6
Nov 22 '16 at 18:12
source share

Try compiling from source, which I do on my mac.

Otherwise, this may help you: http://ubuntuforums.org/showthread.php?t=525257

-one
Mar 31 '11 at 17:56
source share



All Articles