James Kirkby James Kirkby - 1 year ago 271
PHP Question

Xdebug laravel artisan commands

I regularly use xdebug to debug applications, I've built a laravel application that takes an upload of a csv inserts the data to the database and the ids to a job queue.

I've written an artisan command to be run via cron to then do something with this data.

Xdebug works for accessing the site via the browser, but its not breaking on breakpoints when ran from cli.

I run php5-fpm. My files


both contain the following settings:

xdebug.remote_enable = 1
xdebug.idekey = 'dev_docker'
xdebug.remote_autostart = 1
xdebug.remote_connect_back = {{my host ip}}
xdebug.remote_port = 9000

I then run the artisan command

php artisan jobqueue::process --batch-size=10 --sleep=10

I know the command is running as ->info('text') is displayed in the terminal

Anyone know what I'm missing?

Answer Source

According to xdebug.remote_connect_back documentation it's using $_SERVER['REMOTE_ADDR'] to get debugging host. I guess that in CLI you must use xdebug.remote_host instead.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download