I have been working on why Xdebug is not stopping at breakpoints for days. I have read and tried dozens of solutions on StackOverflow. None of them have worked. Is there a method to troubleshoot why the configuration is not working?. Any help would be greatly appreciated since I have been working on this problem for days.
My setup:
I am using Windows 10, which is loaded on drive C. On my F:
drive, I have Laragon (local server), which contains my (PHP v7.2.19) file. My VSCode is also on the F: drive. VSCode uses the extension PHP Debug by Felix Becker.
VSCode Launch.json:
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000,
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000
}
]
I have followed the Xdebug wizard and downloaded & installed everything as instructed. Below is my php.ini file in my Laragon installation.
php.ini
[xdebug]
zend_extension = "F:\Laragon\bin\php\php-7.2.19-Win32-VC15-x64\ext\php_xdebug-3.0.0-7.2-vc15-x86_64.dll"
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
The extension seems to be loaded:
DEBUG Checking PHPLS_ALLOW_XDEBUG
DEBUG The xdebug extension is loaded (3.0.0)
DEBUG Process restarting (PHPLS_ALLOW_XDEBUG=internal|3.0.0|0|*|*)
DEBUG Running f:\laragon\bin\php\php-7.2.19-Win32-VC15-x64\php.exe -n -c C:\Users\Bill\AppData\Local\Temp\CA11.tmp c:\Users\Bill\.vscode\extensions\felixfbecker.php-intellisense-2.3.14\vendor\felixfbecker\language-server\bin\php-language-server.php --tcp=127.0.0.1:13121 --memory-limit=4095M
DEBUG Checking PHPLS_ALLOW_XDEBUG
WARNING Restarted (130 ms). The xdebug extension is loaded (3.0.0)
Is there a way or method to troubleshoot my setup?
Thank you LazyOne for directing me to the answer in the comments. The problem was, I was using XDebug 2 parameters when I should have been using XDebug 3. Thank you also WebEXP0528 for your posting of a suggested answer. However, the reference to the website really helped me understand why I was changing the php.ini file. The webpage reference xdebug.org/docs/upgrade_guide gave a lot of information that helped me troubleshoot the problem.
Old:
New php.ini based on xdebug.org/docs/upgrade_guide: