use*_*986 15 xdebug vagrant laravel laravel-routing homestead
我设置了Laravel 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"
Run Code Online (Sandbox Code Playgroud)
要开始调试会话,我遵循的步骤是
这非常有效.我的问题是当我进入宅基地命令行并且我运行一个php artisan
命令然后我无法让它达到我的断点.
我试过的
XDEBUG_CONFIG="idekey=PHPSTORM" PHP_IDE_CONFIG="serverName=server_name" php -dxdebug.remote_host="127.0.0.1" artisan mycommand
php -d xdebug.profiler_enable=On artisan mycommand
我也试着设置xdebug.remote_autostart=On
,然后sudo service php5-fpm restart
,但仍然是我的断点永远不会打PHPStorm
Ale*_*lex 25
有两件事很重要:
remote_connect_back
无法在CLI情况下工作,因为当您在控制台中时,Xdebug无法检测到远程IP127.0.0.1
从VM内部看到的IP .相反,它通常有像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
Run Code Online (Sandbox Code Playgroud)
不要export PHP_IDE_CONFIG="serverName=yourservername"
在你的虚拟机,在这里yourservername
是你的截图在"名称"配置了什么
使用IDE密钥和上面配置的服务器添加Php远程调试配置
并将您的IDE密钥和remote_host添加到VM的XDEBUG-CONFIG
export XDEBUG_CONFIG="idekey=artisan remote_host=10.0.2.2"
参考文献:http://randyfay.com/content/remote-command-line-debugging-phpstorm-phpdrupal-including-drush
Sab*_*ett 14
或者,如果这一切都太复杂或不起作用 - 您可以使用网址(路线)触发您的工匠命令
Artisan::call('whatever:command');
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
7033 次 |
最近记录: |