Xdebug + atom in development

To anyone that wants to use Xdebug with Atom in development, here is how I did it:

  • Add php-debug atom extension
  • Add these settings in the php-debug settings tab
    – Server listen address: 192.168.50.1. For your case, it may be a different address, in my case, in the xdebug logs this was the address that showed as the client address.
    – Path mapping: [{“remotePath”:"/srv/www/exemple.com/current/web",“localPath”:"/[bedrock local path]/web"}]
  • Add xdebug_break() in your code
  • Add XDEBUG_SESSION_START=session_name as parameter to the URL and access it in a browser to activate the debugger. Ex: http://exmple.com/?XDEBUG_SESSION_START=XDEBUG. Note: An alternative way to activate the debugger is by installing a browser extension. Xdebug-helper for chrome.

Sometimes the debbuger would stop working, if that happens just reactivate by accessing the url with XDEBUG_SESSION_START paremeter set.