Reputation: 37
Previously, my Xdebug was only stopping at the first breakpoint of my code. Then, I decided to reinstall all my set-up (simple MAMP [not PRO] and Xdebug) to try to fix it. But, actually my debugger is not even stepping at the first breakpoint.
I also have been searching and modifying the two php.ini files like I was doing before (https://dillieodigital.wordpress.com/2015/03/10/quick-tip-enabling-xdebug-in-mamp-for-osx/) but none of this work.
Here is my php.ini file:
[xdebug]
zend_extension="/Applications/MAMP/bin/php/php7.4.21/lib/php/extensions/no-debug-non-zts-20190902/xdebug.so"
xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
xdebug.remote_connect_back = 0
My launch.json or workspace in my case:
{
"folders": [
{
"path": "."
}
],
"launch": {
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 0,
"runtimeArgs": [
"-dxdebug.start_with_request=yes"
],
"env": {
"XDEBUG_MODE": "debug,develop",
"XDEBUG_CONFIG": "client_port=${port}"
}
},
{
"name": "Launch Built-in web server",
"type": "php",
"request": "launch",
"runtimeArgs": [
"-dxdebug.mode=debug",
"-dxdebug.start_with_request=yes",
"-S",
"localhost:0"
],
"program": "",
"cwd": "${workspaceRoot}",
"port": 9003,
"serverReadyAction": {
"pattern": "Development Server \\(http://localhost:([0-9]+)\\) started",
"uriFormat": "http://localhost:%s",
"action": "openExternally"
}
}
]
}
}
What I am doing wrong? Probably is something very simple but I don't have any clue.
Upvotes: 0
Views: 1644
Reputation: 36784
Are you using Xdebug 3? Because in that case, the names of the php.ini
settings have changed, you can find the changes in the upgrade guide.
In order to diagnose other issues, please try to debug a PHP file with xdebug_info()
in it, which will tell you whether Xdebug tried to make a connection to your IDE and whether it was successful. If not, it will tell you why.
Upvotes: 3