【发布时间】:2015-11-25 16:13:41
【问题描述】:
我想安装 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
这是我创建的调试器截图:
这是我在名为 HomeController 的控制器的索引方法上的断点截图:
这是 php_info() 页面上的 xdebug 部分:
但每次我在 phpStorm 中按下调试按钮时,主页都会以如下地址打开:
http://localhost:8000/?XDEBUG_SESSION_START=17288
并在调试器选项卡中显示如下消息:
Waiting for incoming connection with ide key '17288'
我在google上研究并尝试了不同的方法但我没有回答。
更新:
新我意识到通过 Xdebug 进行调试在普通项目中工作正常(没有 laravel)。所以这个问题不可能是PHPStorm版本的结果。
例如,当打开页面在localhost:8000 中包含断点时,断点被忽略,但是当我通过localhost/MyProject/public 以正常形式打开该页面时,调试工作正常。
【问题讨论】:
-
1) 请提供通过浏览器捕获的
phpinfo()输出的xdebug 部分 2) 提供xdebug 日志 -- xdebug.org/docs/all_settings#remote_log -
@LazyOne,我添加了
xdebug.remote_log="D:\xdebug.log"选项并运行脚本,但没有创建文件,也没有记录任何内容。 -
1) 这不是我想要的 xdebug 部分。那个更远,并且将具有所有当前的 xdebug 设置 2) 这可能意味着 xdebug 可能未处于活动状态或没有看到调试请求。尝试将
xdebug_break();放在你的代码中(程序断点)。 -
我添加了 Xdebug 部分。
xdebug_break();不返回任何内容。 -
xdebug_break 不应该返回任何东西——它应该触发调试会话。 xdebug 配置似乎没问题。你也可以试试
xdebug.remote_autostart = 1。除此之外 - 尝试再次阅读手册(我不能说缺少什么,特别是因为 xdebug 日志是空的):1)jetbrains.com/phpstorm/quickstart/debugger.html 2)confluence.jetbrains.com/display/PhpStorm/…