【发布时间】:2013-11-03 22:08:58
【问题描述】:
我正在尝试使用 PHP Storm 和 xdebug 从 Drupal 中访问一个模块。我可以点击 index.php 文件,但不能点击这个模块。有什么线索吗?
zend_extension = "c:/wamp/bin/php/php5.3.13/zend_ext/php_xdebug-2.2.0-5.3-vc9.dll"
[xdebug]
xdebug.remote_enable = On
xdebug.profiler_enable = On
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/wamp/tmp"
xdebug.remote_host = "localhost"
xdebug.remote_port = 9000
xdebug.remote_handler = dbgp
当我尝试从调试/服务器部分验证远程环境时,我得到“无法执行验证脚本”。
【问题讨论】:
-
只是为了摆脱愚蠢的问题:你确定你正在调试的那一行是可以访问的——就像你放一个 drupal_set_message('hi');或模具();有吗?您还尝试过模块中的不同断点吗?有时我会花一些时间挠头,然后才注意到我把它放在像 '$somevalue = array(' 这样的行上,它不会让我中断,drupal 有很多。
-
将
xdebug_break();放入您的代码中以从您的代码中手动调用断点。如果 PhpStorm 无法赶上它(考虑到 xdebug 和 IDE 已经正确配置并且通常可以调试),那么文件可能由于符号链接或其他原因而在项目之外(请记住:xdebug 仅在解析/真实路径时IDE 使用它提供的内容)。 -
另一个最明显的通知:xdebug v2.2.0 不是很稳定(不知道这些问题是否适用于您)——2.2 分支的最低推荐版本是 2.2.1——考虑升级你的 xdebug。
标签: php debugging drupal xdebug phpstorm