【发布时间】:2026-01-10 06:15:01
【问题描述】:
我在 Laravel 4.2 Homestead Vagrant box 和 PHPStorm8 EAP 138.1751 中的 PHP 5.5.12 上使用 Xdebug 2.2.5。
在大多数文件上,我可以设置断点并且它可以工作。
Controller\Manage\DashboardController 扩展 Controller\Manage\BaseManageController 扩展 Controller\BaseController 扩展 \Controller。
它不会破坏 DashboardController 内部的任何东西,我不知道为什么。
我试图打破 index() 方法,但它不会。如果我将 index() 移动到 BaseController,那么它将中断它。此外,如果我中断了在我的控制器中调用操作的方法,并手动进入它,它只会跳过它(可以发誓之前至少工作过一次,但现在不行)。
知道是什么原因造成的吗?
这是我的 xdebug 配置:
[xdebug]
xdebug.remote_enable = 1
xdebug.remote_connect_back = 1
xdebug.remote_port = 9000
xdebug.scream=1
xdebug.cli_color=1
xdebug.show_local_vars=0
xdebug.remote_handler = dbgp
xdebug.auto_trace = 1
xdebug.var_display_max_depth=10
xdebug.var_display_max_children=512
xdebug.var_display_max_data=1024
【问题讨论】:
-
1) 程序断点是否有效(通过将
xdebug_break();放入您的代码中)? 2)收集xdebug日志并查看它——也许IDE在错误的文件(错误的路径)等中设置断点——你必须记住xdebug仅适用于最终/已解决的路径,而IDE只适用于文件(符号链接等)
标签: laravel vagrant phpstorm xdebug