Configuring XDebug on a PHP-FPM powered server.
I’ve set up a new local development environment following this excellent guide and all went smooth until I could not debug my code using XDebug.
The above command does show that XDebug is installed and running but the until then working PhpStorm configuration stopped working.
The issue lies in the port that’s used by XDebug by default to connect to servers: the
9000 one; PHP-FPM is listening on that port already and the following command will show it
XDebug allows for the configuration of another port to use so that’s not an issue; I’ve modified my XDebug configuration file to use the port
9009 in place of the default one
[xdebug] zend_extension="/usr/local/opt/php56-xdebug/xdebug.so" xdebug.remote_enable=1 xdebug.remote_host="localhost" xdebug.remote_handler=dbgp xdebug.remote_port=9009 xdebug.remote_autostart=1