Tuesday, February 22

Using Xdebug in command line interface

If you need to debug a PHP script running from the command line, you have to export an environment variable called XDEBUG_CONFIG

For this configuration:


export XDEBUG_CONFIG="idekey=netbeans"


Then just run the script you want to debug

php ./myscript.php argument1 argument2


Remember to start the debuger so the IDE starts listening on the port