auto_prepend_file 破坏了 xdebug
auto_prepend_file breaks xdebug
我正在使用 PHPStorm 2016.2 调试 PHP 5.2(我知道它很旧),
然而,当我在我的 apache vhost 文件中添加 auto_prepend_file 或 auto_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 在第一个断点处停止,然后当我尝试步进 over/in/out 和浏览器 returns "no data received".
时调试停止
我的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
解决方案是像这样移动 apache 虚拟主机末尾的 xdebug.conf
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>
p.s。后来我发现 php_value xdebug.auto_trace off
还在不更改 apache vhost 的情况下修复了此错误。
我正在使用 PHPStorm 2016.2 调试 PHP 5.2(我知道它很旧),
然而,当我在我的 apache vhost 文件中添加 auto_prepend_file 或 auto_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 在第一个断点处停止,然后当我尝试步进 over/in/out 和浏览器 returns "no data received".
时调试停止我的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
解决方案是像这样移动 apache 虚拟主机末尾的 xdebug.conf
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>
p.s。后来我发现 php_value xdebug.auto_trace off 还在不更改 apache vhost 的情况下修复了此错误。