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.
Depending on preference and/or application requirements we can use PhpStorm's built-in webserver to run our application locally, or make use of any other webserver running locally or on a remote machine.
To start a PHP debugging session, we will make use of the Zero-configuration Web Application Debugging with Xdebug and PhpStorm aproach.
From the browser, we can use the PhpStorm debugger bookmarklets or one of the Browser Debugging Extensions to start a PHP debugging session.
<?php // ... ?><!doctype html> <html lang="en"> <head> <script src="index.js"></script> </head> <body> </body> </html>