2016-12-03 70 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