Visual Studio Code won't stop at breakpoint in PHP Xdebug

Finally i know the source of problem. The HP Elitebook have preinstalled program named HP Velocity, which used port 9000.

The issue is port 9000 from my host is bind to port 9000 of HP Velocity software. When HP Velocity service connect to the localhost xdebug server, logs say that connection is ok, but it is connected to HP Velocity.

I changed xdebug port to 9090 in php.ini and changed in launch.json on visual studio code. After that, my visual studio code work as usual and can stop at breakpoint.

Hope this help others :)


The reason might caused by the port of php xdebug.It works for me fine when I did this:

1.use php --ini to show php config file and change xdebug port to 9900: xdebug.remote_port=9900 then restart your php

2.open vscode and change the port to the same number in launch.json: "port": 9900

3.enjoy your debug


In my case, I was trying to debug a php script on my local machine, so I had to realize that I had to debug the php script using the port which the Web Server is using (8080 in my case) rather than using the port set on the VS Code configuration (I use 9090).

For anyone who is stuck with this error, this is my configuration:

  • OS: Windows 10 64 bits
  • PHP 5.6 (32 bits TS)
  • Xdebug 2.5.5 (32 bits)
  • Apache 2.4 (32 bits)
  • Xdebug Helper installed on Google Chrome

1) httpd.conf

Apache Port

2) php.ini (XDebug section)

XDebug Port

3) launch.json (VS Code configuration)

enter image description here