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

标签 php laravel phpstorm

我想安装 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/

相关文章:

php - 按年月归档

php - Mysql新手: sql select problem

php - Laravel 5 IoC 类型提示不起作用

php - 如何将数组传递到 Laravel Controller

PhpStorm 启动时崩溃

html - SCSS-Variables 不显示在前端

php - CSRF token 无效。请尝试重新提交表格

php - 剑道网格行选择

jquery - 如何在 laravel 中使用 jquery load 加载页面?

jquery - 为什么 PhpStorm 不识别 $.post 方法?