I try to get started with Xdebug for multiple hours without success.
First I determined which php_xdebug.dll version I need by visiting this official link, and followed their instructions.
Summary
Xdebug installed: 2.6.0
Server API: Apache 2.0 Handler
Windows: yes - Compiler: MS VC15 - Architecture: x86
Zend Server: no
PHP Version: 7.2.3
Zend API nr: 320170718
PHP API nr: 20170718
Debug Build: no
Thread Safe Build: yes
Configuration File Path: C:\WINDOWS
Configuration File: A:\xampp\php\php.ini
Extensions directory: A:\xampp\php\ext
You're already running the latest Xdebug version
But here are the instructions anyway:
1. Download php_xdebug-2.6.0-7.2-vc15.dll
2. Move the downloaded file to A:\xampp\php\ext
3. Update A:\xampp\php\php.ini and change the line
zend_extension = A:\xampp\php\ext\php_xdebug-2.6.0-7.2-vc15.dll
4. Restart the webserver
This is my php.ini snippet:
[XDebug]
zend_extension="A:\xampp\php\ext\php_xdebug-2.6.0-7.2-vc15.dll"
xdebug.profiler_append = 0
xdebug.profiler_enable = 0
xdebug.remote_enable = on
xdebug.remote_handler = "dbgp"
xdebug.remote_host = localhost
xdebug.remote_port = 9001
xdebug.trace_output_dir = "A:\xampp\tmp"
xdebug.remote_log = "A:\xampp\tmp\xdebug\xdebug.log"
xdebug.idekey = "netbeans-xdebug"
xdebug.remote_autostart = on
xdebug.remote_connect_back = on
I set the port and idekey in netbeans accordingly (Tools -> Options -> PHP -> Debugging).
...I also made sure that the project is using the settings (Project -> Properties -> Run Configuration)
I restarted NetBeans and Apache. I even installed the extension "Xdebug helper" and "NetBeans Connector". The Xdebug helper extension is already configured and set to debug mode.
Now I set a breakpoint. But I get "Waiting For Connection (netbeans-xdebug)" after right clicking in the source code and clicking on "Debug File", and it is loading forever.
I also can't click on the debug buttons, they are all grayed out:
I always call the target site with the following parameter, like instructed in the official documentation: ?XDEBUG_SESSION_START=netbeans-xdebug
I tried different solutions from other questions on SO, but nothing helped.
I already tried to change the line xdebug.remote_host in php.ini to my local ipv4 address, it made no difference. I also tested different ports. Of course I always restarted apache after changing something in the php.ini.
I am using Windows 10 Pro 64 bit and Chrome.
Any ideas? Thanks in advance for any help!
More:
I checked my firewall, the port is not being blocked.




xdebug.remote_connect_back = on(it will ignore remote_host in most cases)xdebug.remote_connect_back = onout after changingxdebug.remote_host. The log showed that it tried to connect to random ip addresses!! Thats because of the chrome extension "ipflood" (ipfuck). After disabling the extension it works!! :)