Debug PHP code with Visual Studio Code
- You need PHP7 at minimum.
- You need Visual Studio Code
1) Install php-debug extension.
In Visual Studio Code, press F1, then erase the > and type "ext install php-debug"
2) Install X-Debug. Use the Wizard since you are on Windows :
3) Edit php.ini as per instructions obtained in step 2 and adding some extra lines. In my cases this was adding these four lines:
zend_extension = php_xdebug-3.0.3-7.4-vc15-x86_64.dll
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.client_port = 9000