PHP debugging from console (xdebug)

Posted: 1

It's easy to google way to set up IDE to remote debugging using http.

But what if you want debug some php script in the console? The solution is simple. You just have to run two lines in console

export PHP_IDE_CONFIG="serverName=<server_name_in_ide>"
export XDEBUG_CONFIG="idekey=<ide_key> remote_host=<worstation_ip>"


Example of usage:

export PHP_IDE_CONFIG="serverName=mylocalwebsote.loc"
export XDEBUG_CONFIG="idekey=PHPSTORM remote_host="

The xdebug file setting is

xdebug.remote_enable = 1
xdebug.remote_port = 9000

To stop debugging execute


This solution for linux. If you run your environment on windows, you'll probably need change export to set in theses lines, but this is not tested by me.

If you find the post helpful you can share it

Ваше мнение:


Stas : 2018-08-24 15:31:05

My favorite IDE for xDebug is CodeLobster:
   other with PHP
drcreazy © 2008-2012 all rights reserved