dongquxiao8545 2015-11-06 10:35
浏览 85
已采纳

Xdebug laravel工匠命令

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 /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

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?

  • 写回答

2条回答 默认 最新

  • douliandan7340 2015-11-08 11:34
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 unity第一人称射击小游戏,有demo,在原脚本的基础上进行修改以达到要求
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line