gpt4 book ai didi

php - 使用 laravel 在 PHPStorm 上等待与 ide key 消息的传入连接

转载 作者:可可西里 更新时间:2023-10-31 23:38:34 28 4
gpt4 key购买 nike

我想安装 debug 并将其与 PhpStorm 集成。

我完成了所有需要的步骤。我将此行添加到 php.ini 文件中:

zend_extension = "D:\wamp\bin\php\php5.5.12\ext\php_xdebug-2.3.3-5.5-vc11-x86_64.dll"
xdebug.extended_info=1
xdebug.remote_enable=1
xdebug.profiler_enable= true
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000

这是我创建的调试器截图:

enter image description here

这是我在名为 HomeController 的 Controller 的索引方法上设置断点的屏幕截图:

enter image description here

这是 php_info() 页面上的 xdebug 部分:

enter image description here

但每次我在 phpStorm 中按下调试按钮时,主页都会打开完整的地址,如下所示:

http://localhost:8000/?XDEBUG_SESSION_START=17288

并在调试器选项卡中显示如下消息:

Waiting for incoming connection with ide key '17288'

我在谷歌上搜索并尝试了不同的方法,但我没有回答。

更新:新我意识到通过 Xdebug 调试在正常项目中工作正常(没有 laravel)。所以这个问题不可能是PHPStorm版本的结果。例如,当打开页面包含 localhost:8000 中的断点时,断点将被忽略,但是当我通过 localhost/MyProject/public 以正常形式打开该页面时,调试工作正常。

最佳答案

即使您已正确设置所有内容,也要注意 PhpStorm 不会在方法声明行中断(就像您在您的案例中所做的那样)。

另见 http://bugs.xdebug.org/view.php?id=618

正如 Derick Rethans 在上面的链接中指出的那样:

PHP doesn't see any code on those lines, so there can not be any breakpoint. However, if you want to break on method calls, the debugging protocol implements that. I don't know whether PHPStorm provides that functionality though.

所以将断点移动到方法内的第一个可执行行,然后重试。

关于php - 使用 laravel 在 PHPStorm 上等待与 ide key 消息的传入连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33921310/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com