PhpStorm-无法接受外部Xdebug连接

PhpStorm-无法接受外部Xdebug连接,php,debugging,phpstorm,xdebug,codeception,Php,Debugging,Phpstorm,Xdebug,Codeception,使用Codeception在PhpStorm中运行应用程序测试时出错。我的代码正在流浪汉中运行 Codeception测试的myindex.php顶行是: ini_set('xdebug.max_nesting_level', 200); 我通过自制程序安装了xdebug,这在我的php版本输出中: PHP 7.1.12 (cli) (built: Dec 2 2017 12:15:25) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend

使用Codeception在PhpStorm中运行应用程序测试时出错。我的代码正在流浪汉中运行

Codeception测试的myindex.php顶行是:

ini_set('xdebug.max_nesting_level', 200);
我通过自制程序安装了xdebug,这在我的php版本输出中:

PHP 7.1.12 (cli) (built: Dec  2 2017 12:15:25) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Xdebug v2.5.5, Copyright (c) 2002-2017, by Derick Rethans   
当我运行测试时,虽然我在PhpStorm事件日志中得到一个错误:

Cannot accept external Xdebug connection: Cannot evaluate expression 'isset($_SERVER['PHP_IDE_CONFIG'])'
在我的PhpStorm设置中,我将其设置为接受外部连接:

在php信息中,我提供了xdebug设置:

$ php -i | grep xdebug                 
Additional .ini files parsed => /usr/local/etc/php/7.1/conf.d/ext-xdebug.ini
xdebug
xdebug support => enabled
xdebug.auto_trace => Off => Off
xdebug.cli_color => 0 => 0
xdebug.collect_assignments => Off => Off
xdebug.collect_includes => On => On
...
xdebug.remote_connect_back => On => On
/usr/local/etc/php/7.1/conf.d/ext xdebug.ini中,我根据设置
xdebug.remote\u connect\u back=1


如何删除
无法接受外部Xdebug连接的错误并运行测试?

我可以通过将远程端口更改为未使用的端口(如9898:

[xdebug]
zend_extension="/usr/local/opt/php71-xdebug/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_connect_back=1
xdebug.idekey="PHPSTORM"
xdebug.remote_port = 9898
然后在PhpStorm设置中更新:

在我的例子中(使用Symfony框架和PhpStorm),它只是与我必须清理的一些缓存有关!我花了2个小时才弄清楚,因为我已经配置好了所有的东西并正确地设置好了,但仍然没有触发事件


因此,每当你遇到这样一个毫无头绪的问题时,请总是清理现金:如果它不起作用,那么就继续执行其他步骤来调试问题的根源。

Hmm,
$\u服务器['PHP\u IDE\u CONFIG']
我认为是用于远程CLI调试的。丢了钥匙
xdebug.idekey=“PHPSTORM”
。已经读过了吗?我的手机可以正常工作,但我必须点击绿色的手机按钮来“收听”,设置idekey并不能修复或更改错误。我在监听调试连接时使用了绿色电话,因此,使用这种方法,您在请求中升起了一个标志,告诉IDE拾取。看看请求,变量是如何在请求中传递的?当我想在IDE中调试时,我使用了浏览器工具栏按钮将其添加进去。现在我们开始: