How to Debug PHP Script From the CLI with PHP-XDEBUG

TL;DR

  1. Set your IDE to listen for incoming connections
  2. On the CLI set the session key,
  3. Set XDEBUG configuration (can be set as environment variables or in-line parameters)

    PS. set remote_host IP to the machine which run the IDE which listen for incoming connections. You can learn how to use ssh to tunnel back the connection from a remote machine back to your local machine.
  4. with PHPSTORM set the IDE config to use

Resources

Related Post

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *