I use PHP debug extension in VS Code. But debugger doesnt see php superglobals at all (like post, get, session…)
enter image description here
While debugging no errors in IDE.
I followed all instructions on Xdebug site: downloaded recomended file and put it in C:MAMPbinphpphp8.1.0ext.
In C:MAMPconfphp8.1.0php.ini I have:
[xdebug]
zend_extension = xdebug
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.client_host = localhost
xdebug.client_port = 80
xdebug.dump.SERVER = REMOTE_ADDR,REQUEST_METHOD
xdebug.dump.GET = *
xdebug.dump.POST = *
xdebug.dump_globals = true
xdebug.log = "C:MAMPbinphpphp8.1.0newlog.log"
In C:MAMPbinphpphp8.1.0php.ini I have (without following code debugger didnt work at all in IDE):
[xdebug]
zend_extension = "C:/MAMP/bin/php/php8.1.0/ext/php_xdebug.dll"
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.client_host = localhost
xdebug.client_port = 80
xdebug.dump.SERVER = REMOTE_ADDR,REQUEST_METHOD
xdebug.dump.GET = *
xdebug.dump.POST = *
xdebug.dump_globals = true
xdebug.log = "C:MAMPbinphpphp8.1.0newlog.log"
I have tried configurations without xdebug.dump – the same result.
In settings.json of VS Code:
"php.validate.executablePath": "C:\MAMP\bin\php\php8.1.0\php.exe",
"phpserver.phpPath": "C:\MAMP\bin\php\php8.1.0\php.exe",
"phpserver.browser": "msedge",
"php.debug.executablePath": "C:\MAMP\bin\php\php8.1.0\php.exe"
Launch.json for PHP debugger extension in IDE I didnt edit.
For debugging, I select “Launch currently open script” configuraion.
I had notifications about validation of php.validate.executablePath (tried edit different ways), but debugger launches in IDE without error in build-in terminal.
OS Windows 10. Local server MAMP
Александр is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.