【问题标题】:How to use Xdebug in PhpStorm如何在 PhpStorm 中使用 Xdebug
【发布时间】:2016-05-25 12:59:14
【问题描述】:

我在代码中使用调试器时遇到了麻烦,这是我第一次使用调试器,我不知道我这样做是否正确,但它对我不起作用。它总是在变量部分显示此消息...

等待 ide key '13001' 的传入连接

我按照这一步...

1.我的 xdebug 的 php.ini 设置

[Xdebug]
zend_extension="D:\XAMMPI\php\ext\php_xdebug-2.4.0-5.6-vc11.dll"
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=80 //i also try the default port (9000) here but it still not working
xdebug.idekey=PHPSTORM

2。我为 Debugger 创建配置设置。

3.我将断点应用于代码进行测试

我正在使用 PhpStorm 2016.1

任何帮助将不胜感激

更新 - 1

【问题讨论】:

标签: php phpstorm


【解决方案1】:

只需使用我的 php.ini 设置进行 xdebug

[XDebug]
zend_extension="D:\XAMMPI\php\ext\php_xdebug-2.4.0-5.6-vc11.dll" ; copied this link based on your config.
xdebug.remote_enable=true
xdebug.remote_host=127.0.0.1
xdebug.remote_port=10000
xdebug.remote_autostart=1
xdebug.idekey=

然后为chrome安装xDebug helper

https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc?hl=en

然后将IDE密钥改为phpstorm

之后,您应该创建一个 PHP 远程调试 而不是 PHP Web 应用程序

如下图所示。

关于您的设置。可以使用Ctrl+Alt S 访问。搜索 Debug 端口,将其更改为 10000。

之后,您应该导航到 chrome 中的扩展程序并激活 xDebug。

就是这样。调试愉快:)

【讨论】:

  • 仍然无法正常工作......它没有像我们通常看到的那样在调试器中显示任何东西,循环数据正在到来。请检查上面的更新 - 1。
  • @stackvr,注意。顺便说一句,这在从头开始设置调试器时应该很有帮助。谢谢。
【解决方案2】:
Waiting for incoming connection with ide key '13001'

xdebug.idekey=PHPSTORM

你需要在 PHPStorm 中设置正确的 idekey,并将端口改回 9000。80 是 apache(http 服务器)的端口,所以它不会像你配置的那样工作。

查看此处了解在 ide 中设置 idekey 的位置:https://www.jetbrains.com/help/phpstorm/2016.1/run-debug-configuration-php-remote-debug.html

【讨论】:

    猜你喜欢
    • 2017-05-30
    • 1970-01-01
    • 1970-01-01
    • 2021-03-13
    • 2014-01-16
    • 1970-01-01
    • 2013-07-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多