allo zusammen,
jemand weiss wie kann ich ein brakepoint setzten in VSCode? Ich versuche mal den PHP code debuggen. Ich nuzte das development template.
vielen Dank
Jorge
allo zusammen,
jemand weiss wie kann ich ein brakepoint setzten in VSCode? Ich versuche mal den PHP code debuggen. Ich nuzte das development template.
vielen Dank
Jorge
PhpStorm ist aber wesentlich besser geeignet für diesen Zweck.
If someone is interested, here is how I get to debug the development template using VSCode:
2. Copy the output into https://xdebug.org/wizard
Follow the instruction and install xdebug.
Add the following at the end of /opt/docker/etc/php/php.ini, make sure the zend_extension path is correct.
[XDebug]
zend_extension = /usr/local/lib/php/extensions/no-debug-non-zts-20170718/xdebug.so
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_connect_back = 1
xdebug.remote_port = 9090
Close the container and restart it, this is important!
Install "Xdebug helper " chrome extension.
Install “PHP Debug extension by Felix Becker” VSCode extension
Create a launch.json, add the paths you want to debug in pathMappings, and make sure you ignore vendor/ and var/ This is what works for me:
{
“version”: “0.2.0”,
“configurations”: [
{
“name”: “Listen for XDebug”,
“type”: “php”,
“request”: “launch”,
“port”: 9090,
“ignore”:[
" /vendor/ /.php",
"/app/var/**/.php"
],
“pathMappings”: {
“/app/custom/plugins”: “${workspaceRoot}/plugins”
}
}
]
}
Set some breakpoints in your code and hit F5
Happy coding