2016-12-03 69 views
3

我在Windows上,我试图通过XDebug使用PhpStorm来调试一个Web应用程序(由Vagrant/Homestead托管)。我尝试了很多配置,但是我无法正常工作。 PhpStorm XDebug安装非常普遍。Vagrant Homestead上的PhpStorm和XDebug

这是当前的XDebug配置:

流浪@家园:/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仍在聆听。 有什么想法?

回答

3

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

UPDATE

我不知道的Apache和Nginx的之间的差异(这可能是/etc/php/7.0/fpm/conf.d/20-xdebug.ini),但这里是我得到了它与VM VirtualBox的工作运行Apache,在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 
+0

凯蒂感谢您的回答。我跟着很多指南,没有提到apache。我猜想流浪的宅基地运行nginx而不是apache。另外,phpinfo()似乎报告了正确的值。我想这是一个phpstorm和流浪虚拟机通信之间的问题,但我真的不明白什么是错的.. – zangarmarsh

+0

也许这可以帮助:http://stackoverflow.com/questions/15339165/cannot-debug-with-phpstorm-vagrant- xdebug?rq = 1 – Katie

+0

@zangarmarsh,看到我的更新... – Katie