A while back I succeeded at resolving this problem:
Now I have PHP 8 with the latest VSCode and Xdebug 3, but my breakpoint is not hit in my API, which runs with a custom host name renamed from localhost (virtual host) in back of a Node.js ReactJS app (on riskaim:3000, where as the PHP API server is running on riskaim:9003)
I can't get the VSCode debugger to stop on the line on which I have set a breakpoint.
How do I resolve this?
Here are my settings:
Bottom of php.ini c:/wamp64/bin/apache/php/apache2.4.46/bin/php.ini
; XDEBUG Extension
[xdebug]
zend_extension="c:/wamp64/bin/php/php8.0.9/ext/php_xdebug-3.0.4-8.0-vs16-x86_64.dll"
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_connect_back = 1
xdebug.remote_mode = "req"
xdebug.mode = debug
xdebug.client_port = "9003"
xdebug.remote_log = "c:/wamp64/tmp/log"
xdebug.show_local_vars = 0
xdebug.idekey = vsc
settings.json
{
"php.executablePath": "C:/wamp64/bin/php/php8.0.9/php.exe",
}
launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003
}
]
}
Middle of httpd.conf
#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 9003
httpd-vhosts.conf
# Virtual Hosts
#
<VirtualHost *:9003>
ServerName localhost
DocumentRoot "${INSTALL_DIR}/www/"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:9003>
ServerName riskaim
DocumentRoot "${INSTALL_DIR}/www/RiskAIM/"
<Directory "${INSTALL_DIR}/www/RiskAIM/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
It turns out I had added an unnecessary line in my
.htaccessfile of my api folder. Removal of this line fixed the problem and the debugger step cursor started working successfully.Changes made
.htaccess
Bottom of php.ini (c:/wamp64/bin/apache/apache2.4.46/bin/php.ini)
launch.json
httpd.conf Middle of file
httpd-vhosts.conf