【问题标题】:auto_prepend_file breaks xdebugauto_prepend_file 中断 xdebug
【发布时间】:2017-03-13 16:03:14
【问题描述】:

我正在使用 PHPStorm 2016.2 调试 PHP 5.2(我知道它很旧),

但是当我在我的 apache vhost 文件中添加 auto_prepend_fileauto_append_file 时:

    php_value auto_prepend_file /home/abc/def/apache_prepend.php
    php_value auto_append_file /home/abc/def/apache_append.php

xdebug 中断。

IDE 在第一个断点处停止,然后当我尝试跨步/进/出时调试停止,并且浏览器返回“未收到数据”。

我的 xdebug.conf 文件:

#[xdebug]
php_value xdebug.remote_enable on
#php_value xdebug.default_enable on
php_value xdebug.remote_autostart off
php_value xdebug.remote_port 9000
php_value xdebug.remote_host 192.168.100.66
php_value xdebug.profiler_enable 0
php_value xdebug.profiler_enable_trigger 1
php_value xdebug.profiler_output_name cachegrind.out-%H-%R-%t
php_value xdebug.profiler_output_dir /home/abc/xdebug-profile
php_value xdebug.trace_enable_trigger 1   
#php_value xdebug.auto_trace off
php_value xdebug.trace_output_name trace.out-%H-%R-%t
php_value xdebug.trace_format 1
php_value xdebug.idekey PHPSTORM

【问题讨论】:

  • 如果您将xdebug.auto_trace 设置为true,它会改变什么吗?
  • 我试过了,没有任何变化

标签: php phpstorm xdebug


【解决方案1】:

解决方案是像这样将 xdebug.conf 移动到 apache 虚拟主机的末尾

        SetEnv ENVIRONMENT dev
        php_value auto_prepend_file /home/abc/prepends/apache_prepend.php
        php_value auto_append_file /home/abc/apache_append.php

        #INCLUDE XDEBUG AT THE END 
        Include /home/abc/projects/hello/site/vhosts/xdebug_notrace.conf

</VirtualHost>

附言后来我发现 php_value xdebug.auto_trace off 在不改变 apache vhost 的情况下也修复了这个 bug。

【讨论】:

  • 获得答案并避免发放赏金的好方法:D 干得好。
  • 无论如何,你不会得到赏金。阅读How Bounty works to know more
  • 我不在乎赏金
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-07-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多