Created
November 12, 2014 09:58
-
-
Save keopx/5132c32c73d6a9e06fd9 to your computer and use it in GitHub Desktop.
Install Xdebug and configure it with Netbeans
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Installing Xdebug | |
1. Install Xdebug for php | |
sudo apt-get install php5-xdebug | |
2. Setup xdebug.ini for ubuntu | |
vim /etc/php5/fpm/conf.d/20-xdebug.ini | |
Add following lines: | |
xdebug.profiler_output_dir=/tmp | |
xdebug.profiler_output_name=cachegrind.out.%p | |
xdebug.profiler_enable_trigger=1 | |
xdebug.profiler_enable=0 | |
xdebug.remote_enable=true | |
xdebug.remote_host=127.0.0.1 | |
xdebug.remote_port=9001 | |
xdebug.remote_handler=dbgp | |
xdebug.remote_autostart=0 | |
3. Restart php5-fpm | |
sudo service php5-fpm restart | |
Configuring Netbeans: | |
xdebug-netbeans | |
Go to Tools > Options > PHP > Debugging | |
Set Debugging Port : 9001 | |
Start Debugging your project by Ctrl+F5 or file by Ctrl+Shift+F5 | |
For WordPress Plugin/Theme: | |
WordPress-Xdebug-Netbeans-1 | |
Go to Project Properties > Run Configuration. Set Project URL. | |
Go to Advanced Options. | |
SourceCode-xdebug-Netbeans-Mapping | |
Map your local project path (source code directory) with the server path (plugin/theme directory on your server). | |
Start Debugging your theme/plugin. | |
For more details, check out the Xdebug Documentation. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment