Xdebug.ini Configuration For XDebug Version 2

From Littledamien Wiki
Jump to navigation Jump to search
XDebug is currently at version 3. These settings are outdated and archived here. See Debugging Web Applications In PHPStorm With XDebug and Docker for current xdebug.ini settings.
zend.extension="/usr/local/lib/php/extensions/no-debug-non-zts-20170718/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_handler="dbgp"
xdebug.remote_port=9001
xdebug.remote_autostart=1
xdebug.remote_connect_back=0
xdebug.idekey="docker"
xdebug.remote_host=docker.for.mac.localhost
xdebug.remote_log="/tmp/xdebug.log"
  • xdebug.idekey refers back to the IDE key entered in PHPStorm's run configuration.
  • xdebug.remote_host could be the IP address of the local machine, but this would have to be changed any time the IP address changes. See below for the work-around that explains the setting above.
    • In a Mac OS terminal find the current IP with ipconfig getifaddr en0
  • xdebug.remote_connect_back must be set to "0" or else it would override the xdebug.remote_host settting.
  • xdebug.remote_port must be the same as PHPStorm > Preferences > Languages & Frameworks > PHP > Debug > Xdebug > Debug Port.
  • If you're debugging more than one PHP web application, then you either remove all Docker images except the one for the current app, or make sure that they are using different ports.