简体   繁体   English

Homestead 5,Xdebug,PHP 7和PhpStorm

[英]Homestead 5, Xdebug, PHP 7, and PhpStorm

I am trying to use Xdebug in PhpStorm with a Homestead 5.0 Vagrant box using PHP 7.0. 我试图在PhpStorm中使用Xdebug和使用PHP 7.0的Homestead 5.0 Vagrant框。 I am using macOS Sierra. 我正在使用macOS Sierra。

My problem: 我的问题:

PhpStorm can not find the Xdebug debugger in the PHP interpreters dialog box. PhpStorm在PHP解释器对话框中找不到Xdebug调试器。 It says "Debugger: Not installed". 它说“调试器:未安装”。

在此输入图像描述

Things I have done: 我做的事情:

In /etc/php/7.0/fpm/conf.d, my 20-xdebug.ini has the following code: 在/etc/php/7.0/fpm/conf.d中,我的20-xdebug.ini具有以下代码:

zend_extension=xdebug.so

xdebug.remote_enable=1
xdebug.remote_connect_back = 1
xdebug.remote_port = 9000
xdebug.max_nesting_level = 250
xdebug.remote_autostart=1

I have restarted the php7.0-fpm using sudo service php7.0-fpm restart . 我已经使用sudo service php7.0-fpm restart

I have read from other community forums that Xdebug comes installed on Homestead 5. However, when I run php -m | grep xdebug 我从其他社区论坛上读到,在Homestead 5上安装了Xdebug。但是,当我运行php -m | grep xdebug php -m | grep xdebug the xdebug extension is not listed. php -m | grep xdebug未列出xdebug扩展名。 Yet, when I run phpinfo() xdebug is listed. 然而,当我运行phpinfo() xdebug被列出。

I have ensured that my IDE is using port 9000, my IDE key is 'vagrant' in both places. 我确保我的IDE使用端口9000,我的IDE密钥在两个地方都是'vagrant'。

Thank you for the help! 感谢您的帮助!

Additional screenshots: 其他截图: 在此输入图像描述

I was able to get XDebug working a few weeks ago with the latest version of Homestead as of writing this on 2017-05-13. 几个星期前,我在最新版本的Homestead上发布了XDebug,这是在2017-05-13上写的。 PhpStorm will not detect my XDebug extension in the GUI. PhpStorm不会在GUI中检测到我的XDebug扩展。 That was where the break-down was occurring in my attempts to get things up and running after a fresh install of Homestead was created. 这就是我在创建Homestead的全新安装后尝试启动和运行时发生故障的地方。

However, after installing XDebug in my VM, setting up the xdebug php extension file, and configuring everything back to how it would have normally functioned, it worked on my first (re)attempt at debugging. 但是,在我的VM中安装XDebug,设置xdebug php扩展文件,并将所有内容配置回正常运行的方式之后,它在我的第一次(重新)尝试调试时工作。

This guide is how I originally learned how to set up the configurations in PhpStorm. 指南是我最初学习如何在PhpStorm中设置配置的方法。 It does not discuss setting an ide-key and some other small things, but most of which are easily discoverable. 它没有讨论设置ide-key和其他一些小东西,但大多数都很容易被发现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM