Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

PHP XDebug

James Silver edited this page Jun 5, 2013 · 2 revisions

We install and configure the XDebug PHP extension by default.

Configuration

XDebug is configured with sensible defaults, but as these are simply PHP configuration variables they can easily be changed in the same way as any other PHP configuration

We configure XDebug to make connections to the host machine, on port 9000 over the dbgp protocol.

Our XDebug base configuration looks like this:

[XDebug]
; Enable remote debugging
xdebug.remote_enable=1
; Stop potential inifinte loops, while allowing enough depth for Drupal
xdebug.max_nesting_level=200
xdebug.remote_handler=dbgp

; Set the remote address to the default address of our host machine, magic.
xdebug.remote_host=10.0.2.2
xdebug.remote_port=9000
; Output links compatible with the PHPStorm Remote Call plugin running on the host. 
xdebug.file_link_format="javascript:var rq = new XMLHttpRequest(); rq.open(\"GET\", \"http://localhost:8091?message=%f:%l\", true); rq.send(null);"

PHPStorm Remote Call plugin

If you use the PHPStorm IDE for development then install the 'Remote Call' plugin from the Plugins manager inside PHPStorm (Preferences > Plugins). Now the rows in XDebug stack traces (which are displayed in the browser when there's a fatal error) will be clickable links which jump you straight to the file/line in PHPStorm!

Clone this wiki locally