编程语言
首页 > 编程语言> > PhpStorm和XDebug在Vagrant Homestead上

PhpStorm和XDebug在Vagrant Homestead上

作者:互联网

我在Windows上,尝试通过XDebug使用PhpStorm调试Web应用程序(由Vagrant / Homestead托管).我尝试了许多配置,但无法正常工作. PhpStorm XDebug设置非常普遍.

这是当前的xdebug配置:

vagrant @ homestead:/etc/php/7.0/cli/conf.d/20-xdebug.ini

zend_extension=xdebug.so
xdebug.remote_enable = on
xdebug.remote_connect_back = on
xdebug.idekey='PHPSTORM'

在IDE“开始侦听PHP调试连接”中,将其打开.当我尝试开始调试时,会打开一个新的chrome选项卡,并且URL以?XDEBUG_SESSION_START = 16588结尾,但是调试器无法运行,这就是IDE所说的:

enter image description here

另外,netstat表示端口9000仍在侦听.
任何想法?

解决方法:

您正在更改命令行界面(CLI)的20-xdebug.ini文件.相反,由于您使用的是Chrome,因此您需要更改/etc/php/7.0/apache2/conf.d/20-xdebug.ini的Apache设置.

更新

我不确定Apache和Nginx之间的区别(可能是/etc/php/7.0/fpm/conf.d/20-xdebug.ini),但是这是我如何将其与运行Apache的VirtualBox VM一起使用的在Windows计算机上.

20-xdebug.ini的设置:

zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_host=192.168.1... (your windows IP address within your network)
xdebug.remote_port=9000
xdebug.autostart=1

标签:homestead,phpstorm,xdebug,vagrant,php
来源: https://codeday.me/bug/20191026/1936725.html