Xdebug laravel工匠命令

Xdebug laravel工匠命令

问题描述:

我经常使用xdebug调试应用程序,我构建了一个laravel应用程序,该应用程序将csv的上载插入到数据库中,并将ID插入到作业队列中.

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.

我已经编写了一个artisan命令,可以通过cron运行该命令,然后对该数据进行处理.

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

Xdebug可以通过浏览器访问该站点,但是从cli运行时,它不会在断点处中断.

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

我运行php5-fpm.我的文件/etc/php5/fpm/php.ini/etc/php5/cli/php/ini 两者都包含以下设置:

I run php5-fpm. My files /etc/php5/fpm/php.ini and /etc/php5/cli/php/ini both contain the following settings:

zend_extension=/usr/lib/php5/20121212/xdebug.so 
xdebug.remote_enable = 1 
xdebug.idekey = 'dev_docker' 
xdebug.remote_autostart = 1 
xdebug.remote_connect_back = {{my host ip}} 
xdebug.remote_port = 9000 
xdebug.remote_handler=dbgp

然后我运行工匠命令

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

我知道命令正在运行,因为终端中显示了info('text')

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

有人知道我想念什么吗?

Anyone know what I'm missing?

根据 xdebug.remote_connect_back href ="http://xdebug.org/docs/all_settings#remote_connect_back" rel ="nofollow"> xdebug.remote_connect_back 文档,它使用$_SERVER['REMOTE_ADDR']获取调试主机.我猜想在CLI中,您必须改用 xdebug.remote_host .

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.