1. Listen for PHP debug connections
In PhpStorm, toggle the Listen for PHP Debug Connections button in the toolbar. Alternatively use the Run | Start listen for PHP Debug Connections menu.
We do not have to setup any Run/Debug Configurations for this. As outlined in Zero-configuration Web Application Debugging with Xdebug and PhpStorm, Listen for PHP Debug Connections will make PhpStorm accept incoming debugger connections initiated by Xdebug or Zend Debugger.
- Enter the full URL to the page we want to debug on the webserver
- Optionally, provide some mappings so PhpStorm can determine where to find local files relative to the remote URL. This will only be required in complex setups.
- Enter the full URL to the page we want to debug on the webserver. Make sure to append the XDEBUG_SESSION_START=some-session-name URL parameter, e.g. ?XDEBUG_SESSION_START=phpstorm
- Listen for PHP debug connections
- Start the newly created Debug configuration
<?php // ... ?><!doctype html> <html lang="en"> <head> <script src="index.js"></script> </head> <body> </body> </html>