从PHPStorm与homestead调试laravel artisan
我建立了拉维尔家园。然后,我配置了homestead xdebug.ini和PHPStorm,以使调试工作正常 这是我家里的xdebug.ini从PHPStorm与homestead调试laravel artisan,laravel,vagrant,xdebug,laravel-routing,homestead,Laravel,Vagrant,Xdebug,Laravel Routing,Homestead,我建立了拉维尔家园。然后,我配置了homestead xdebug.ini和PHPStorm,以使调试工作正常 这是我家里的xdebug.ini zend_extension=xdebug.so xdebug.remote_autostart = on xdebug.remote_enable = on xdebug.remote_connect_back = on xdebug.remote_port = 9000 xdebug.idekey = "vagrant" 要启动调试会话,我遵循以
zend_extension=xdebug.so
xdebug.remote_autostart = on
xdebug.remote_enable = on
xdebug.remote_connect_back = on
xdebug.remote_port = 9000
xdebug.idekey = "vagrant"
要启动调试会话,我遵循以下步骤
php artisan
命令时,我无法让它达到断点
我尝试过的
zend_extension=xdebug.so
xdebug.remote_autostart = on
xdebug.remote_enable = on
xdebug.remote_connect_back = on
xdebug.remote_port = 9000
xdebug.idekey = "vagrant"
XDEBUG\u CONFIG=“idekey=PHPSTORM”PHP\u IDE\u CONFIG=“serverName=server\u name”PHP-dxdebug.remote\u host=“127.0.0.1”artisan mycommand
php-d xdebug.profiler\u enable=在artisan mycommand上
xdebug.remote_autostart=On
然后sudo服务php5 fpm重启
,但我的断点在PHPStorm中始终没有被命中有两件事很重要:
remote\u connect\u back
无法在CLI情况下工作,因为当您在控制台中时,Xdebug无法检测到远程IP127.0.0.1
。相反,它通常具有类似IP的10.0.2.2
。要找到正确的IP,请查看Apache的access.log
php -dxdebug.remote_autostart=on -dxdebug.remote_connect_back=off
-dxdebug.remote_host=10.0.2.2 artisan
yourservername
是您在“name”下的屏幕截图中配置的参考资料:或者,如果这一切太复杂或不起作用,您可以使用url(路由)触发artisan命令
Artisan::call('whatever:command');
您最终成功了吗?您通过单击行的开头在IDE中添加断点。或者您在询问其他问题吗?使用这些参数部分有效:调试器在artisan main()处停止.我可以一步一步地完成自动加载过程,但当我点击run按钮时,它会错过命令fire()中的断点method@SalvadorMaine:编辑我的答案(请参见步骤3。)我想还有更多……我刚刚添加了第4点。试一试这个答案应该被标记为正确!工作完美无瑕!太棒了。我浪费了2个小时的宝贵生命来设置其他东西,但都是徒劳的。下面是一个精彩的回答来拯救这一天:-)我在过去尝试过配置,但仍然没有成功。。。。这确实是最简单的解决方案,我只是创建了一个路由,我将在部署时对其进行注释。。。。在这个配置上浪费了太多的时间,这似乎是一个可行的解决方案,谢谢。它可以工作,但我希望我能想出如何在没有它的情况下让它工作!如果有人得到解决方案,请发布!