I am trying to debug some PHP code and wanted to download the XDebug debugger for PHP. All I see there is Windows binaries for downloading. Is it at all possible to use it on Ubuntu?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
::ubuntu 18.04, php7.2, apache2:: 1. First install xdebug using
sudo apt-get install php-xdebug
. 2. This will create file /etc/php/7.2/mods-available/xdebug.ini 3. You can runsudo phpenmod xdebug
4. open xdebug.ini usingsudo nano /etc/php/7.2/mods-available/xdebug.ini
5. you can see only the line: zend_extension=xdebug.so 6. assuming running php apache on localhost and netbeans IDE, add following line to xdebug.iniN.B: xdebug.idekey and xdebug.remote_port can be obtained from netbeans tools->optins->php->debug
This article was what helped me in Ubuntu 16.04 running PHP7:
Link to article
On a newer Ubuntu (at least on 14.04 LTS), I needed to activate the module as well. So, in total I did:
After a restart of the server, xdebug was available.
Execute the following commands in your terminal.
Download Xdebug - you will need to follow alternate instructions if you don't have PHP5 working on your machine already.
The package should modify your INI file for you, but just in case you need to edit it yourself open it up and make the following modification - on Ubuntu its typically at /etc/php5/apache2/php.ini - add the following line.
That path might be a little different on your system - just make sure its a fully qualified path to the xdebug.so file on your machine. Also remember to comment out any references to the Zend Debugger - you can't run both at the same time.
Now restart Apache.
You may also need want enable html_errors. Search for html_errors in /etc/php5/apache2/php.ini and make sure it is set to On. A restart of Apache is also required.
Double-check with phpinfo() to make sure that everything is installed properly - you may also want to set configurations for Xdebug in your php.ini file.
Try compiling from source, that's what I do on my mac.
Otherwise, this might help you: http://ubuntuforums.org/showthread.php?t=525257