Netbeans + Xdebug + php not working

My netbeans do not work with breakpoints using xdebug, my configuration looks right, so I configured the first time I ran up to stop debugging for the first time since it never worked, did anyone have this problem? My netbeans version is 6.8 and php version is 2.5.2.

my php.ini:

zend_extension_ts = d:\wamp\bin\php\php5.2.5\ext\php_xdebug-2.0.2-5.2.5.dll xdebug.remote_enable=on xdebug.remote_handler=dbgp xdebug.remote_host=localhost xdebug.remote_port=9000 xdebug.idekey=netbeans-xdebug xdebug.profiler_enable=1 
+6
php xdebug netbeans
Jun 03 2018-10-06T00:
source share
8 answers

In my case, this line should be included in php.ini:

 xdebug.remote_autostart=on 

Here is the configuration section for XDebug:

 [xdebug] xdebug.remote_enable = on xdebug.remote_handler=dbgp xdebug.remote_host=localhost xdebug.remote_port=9000 xdebug.idekey="netbeans-xdebug" xdebug.remote_autostart=on xdebug.profiler_enable = on xdebug.profiler_enable_trigger = on xdebug.profiler_output_name = cachegrind.out.%t.%p xdebug.profiler_output_dir = "d:/wamp/tmp" 
+8
Jan 10 '14 at 1:54
source share

Checklist for xdebug:

  • Make sure xdebug is loaded in phpinfo() and the runtime value matches the expected configuration .
  • xdebug.remote_enable on .
  • xdebug.extended_info must be on for breakpoints to work.
  • xdebug.remote_port should be the same as ide and not used .
  • xdebug.remote_handler dbgp .
  • xdebug.idekey must be set to the same as the ide key if xdebug.remote_autostart enabled.
  • Sometimes it helps to set xdebug.remote_host for the IP intranet or computer name instead of the local ip 127.0.0.1. PHP must be enabled by the firewall to connect to this host and port.
  • Setting xdebug.remote_log to a file will help verify what is wrong. Disable logging as soon as debugging works.

Configuration Example:

 [xdebug] xdebug.extended_info=on xdebug.remote_enable=on xdebug.remote_handler=dbgp xdebug.remote_host=localhost xdebug.remote_port=9000 xdebug.remote_autostart=on xdebug.idekey="netbeans-xdebug" 

Checklist for NetBeans:

  • The firewall should allow Netbeans to listen on the connection to the configured host.
  • Tools -> Options -> PHP -> Debugging, check the port. Also check the session ID if xdebug.remote_autostart is enabled.
  • The type of project must be PHP.
  • Project Properties -> Source, web root should be correct.
  • Project properties → Run configuration, the index file must be php (or empty) for Ctrl + F5 to work.
  • Project Properties → Run Configuration → Advanced, the debug URL should be “Default” or “Ask Every Time”.
  • Project Properties -> Run Configuration -> Advanced, route mapping must be correct. (e.g. empty if no mappings)

(Most of the default options work out of the box, so if you are desperate to delete and recreate the project.)

False instructions tested on PHP 5.5 and xdebug 2.2:

  • PHP output_buffering does not need to be disabled. (But may help in debugging)
  • You can download the OPCache module (Zend Cache).
  • xdebug.profiler_enable can be activated.

Please edit this answer if you find something new.

+4
Mar 31 '15 at 10:41
source share
  • Make sure you have the correct version of Xdebug for your version of PHP (including thread safe / non thread safe and 64 bit / 32 bit).
  • In some newer versions of PHP, you need to use zend_extension rather than zend_extension_ts, regardless of whether you have a version of TS Xdebug.
+1
Jun 03 2018-10-06T00:
source share

(I am responding with the answer as formatting in the comments does not work properly)

The same thing happened for me: I worked once, and then stopped. However, I reached a point in my configuration where it started working without problems, and I can share.

First, I moved over the php.ini bootloader icon:

 [PHP] zend_extension=/Applications/MAMP/bin/php5/zend/lib/ioncube_loader_dar_5.2.so 

Then I put these lines in the xdebug configuration:

 [xdebug] zend_extension="/Applications/MAMP/bin/php5/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so" xdebug.default_enable=1 xdebug.remote_enable=1 xdebug.remote_handler=dbgp xdebug.remote_host=localhost xdebug.remote_port=9000 

And commented on all the lines about Zend Optimizer

 [Zend] ;zend_optimizer.optimization_level=15 ;zend_extension_manager.optimizer=/Applications/MAMP/bin/php5/zend/lib/Optimizer-3.3.3 ;zend_optimizer.version=3.3.3 

I am working on MAMP, so the paths to my libraries refer to my MAMP folder.

Good luck.

+1
Dec 12 '10 at 18:30
source share

If you are still stuck, you can try the following:

  • Download the new version of xdebug through the wizard ( http://www.xdebug.org/wizard.php ), and if you follow the instructions, you might be lucky.
  • You can disable the firewall.
  • Use a different port in netbeans, for example in my case using 9001 in netbeans and 9000 in xdebug.
  • Add to php.ini file : xdebug.idekey=netbeans-xdebug .
  • Find out if you have an xdebug.ini file and add the php.ini lines associated with xdebug to this file.

Always check that you restart the apache service to check everything.

+1
Dec 17 '12 at 14:44
source share

zend_extension = "C:\xampp\php\ext\php_xdebug-2.2.3-5.4-vc9.dll"xdebug.remote_enable = 1 xdebug.remote_handler = "dbgp"xdebug.remote_host = "localhost" xdebug.remote_port="9000" xdebug.remote_mode=req xdebug.trace_output_dir = "C:\xampp\tmp" xdebug.idekey="netbeans-xdebug"

it works for me ..

+1
Oct 11 '13 at
source share

Here's how I managed to get it to work with w / mulitple PHP-FPM homebrew installations.

I used this wonderful article for several installations:

https://echo.co/blog/os-x-1010-yosemite-local-development-environment-apache-php-and-mysql-homebrew

In the comments of this post you will see how to install xdebug, the bottom line:

 brew install php56-xdebug 

You need to install xdebug for all PHP versions that you have installed. Homebrew will create an xdebug.ini file for each version of php you install. Each of them will have the following path:

 /usr/local/etc/php/<version # ie "5.6">/conf.d/ext-xdebug.ini 

This article describes DNSMasq, which runs on the xdebug port by default (9000), so you need to change the xdebug port to something else (9001 works fine.)

Edit the above ext-xdebug.ini file (or files if you have installed more than one php version.) Here is what works for me:

 [xdebug] zend_extension="/usr/local/opt/php56-xdebug/xdebug.so" ; General config ; Dumps local variables on exception xdebug.show_local_vars=On ; Dump server variables xdebug.dump.SERVER=* ; Dump global variables xdebug.dump_globals=On xdebug.collect_params=4; ; Tracing ;xdebug.auto_trace=On ;xdebug.trace_output_dir= /opt/local/php_traces/ xdebug.show_mem_delta=On xdebug.collect_return=On ; Debugging. You might need to specify your host with some additional options xdebug.remote_enable=1 : from http://devzone.zend.com/1147/debugging-php-applications-with-xdebug/ xdebug.remote_host="localhost" xdebug.remote_port=9001 xdebug.remote_handler="dbgp" 

The first two lines are all that is in the source homebrew file.

BTW - when I installed several versions of PHP, this ext-xdebug.ini file was created only for the first version of PHP that I installed. I just copied this file to other places in the PHP version and changed part of the “php56-xdebug” path in line 2 to display the correct php version.

Pay attention to "xdebug.remote_port = 9001"

Then in Netbeans (I use Mac OSO 10.02 osX10.10.3), I use the following settings. Go to Settings-> PHP-> Debugging

Debug Port: 9001

Stop on the first line: ( not marked )

Clock and ball rating: ( marked ) - there is a warning, but it works fine for me.)

It is also worth noting that in order for xdebug to be displayed using phpinfo () (or the php -i command line), I need to restart apache with

 launchctl unload -Fw ~/Library/LaunchAgents/homebrew.mxcl.php56.plist sudo apachectl restart launchctl load -Fw ~/Library/LaunchAgents/homebrew.mxcl.php56.plist 

For some reason, my installation requires me to run it every time I start it. Kind of pain, but I included it in the shell command to easily switch between versions.

Another hint: the brew info php56 part says:

 OS X 10.8 and newer come with php-fpm pre-installed, to ensure you are using the brew version you need to make sure /usr/local/sbin is before /usr/sbin in your PATH: PATH="/usr/local/sbin:$PATH" 

Until I added this to the .profile_bash file, the changes I made to each php-fpm.conf version file were not recognized. Everything else seemed to work, so this is confusing.

Hope this saves someone time and trouble.

+1
Apr 11 '15 at 3:22
source share

In my case - the host is on another server, Net-beans 11 - I need to open a terminal on a remote host

Window → IDE Tools → Terminal → Remote Terminal

Postscript If you enter export XDEBUG_CONFIG = "idekey = netbeans-xdebug" in this terminal and start a debugging session, you can debug console scripts

0
Sep 18 '19 at 10:08
source share



All Articles