dongxiaoxiao1983 2015-11-12 19:53
浏览 123

xdebug只能通过从cli而不是浏览器运行脚本来触发

I have a Docker container running apache2 php5 and xdebug. I can only trigger xdebug when I run a php script from the command line via root on the docker container. I get an xdebug log file with the following entries:

Log opened at 2015-11-12 19:34:30  
I: Checking remote connect back address.  
I: Checking header 'HTTP_X_FORWARDED_FOR'.  
I: Checking header 'REMOTE_ADDR'.  
W: Remote address not found, connecting to configured address/port: 192.168.9.12:9000. :-|  
I: Connected to client. :-)  

When I try to connect to a simple hello world php page via a browser and an XDEBUG_SESSION cookie I get no response from xdebug. I do get the page sent back to the browser, but no entry into the xdebug log file.

I think I may have some sort of permissions issue. Apache is run under the www-data user while the script is run under root. Below is my xdebug configuration:

xdebug  

xdebug support => enabled  
Version => 2.4.0beta1  
IDE Key => PHPSTORM  

Supported protocols => Revision  
DBGp - Common DeBuGger Protocol => $Revision: 1.145 $  

Directive => Local Value => Master Value  
xdebug.auto_trace => Off => Off  
xdebug.cli_color => 0 => 0  
xdebug.collect_assignments => Off => Off  
xdebug.collect_includes => On => On  
xdebug.collect_params => 0 => 0  
xdebug.collect_return => Off => Off  
xdebug.collect_vars => Off => Off  
xdebug.coverage_enable => On => On  
xdebug.default_enable => On => On  
xdebug.dump.COOKIE => no value => no value  
xdebug.dump.ENV => no value => no value  
xdebug.dump.FILES => no value => no value  
xdebug.dump.GET => no value => no value  
xdebug.dump.POST => no value => no value  
xdebug.dump.REQUEST => no value => no value  
xdebug.dump.SERVER => no value => no value  
xdebug.dump.SESSION => no value => no value  
xdebug.dump_globals => On => On  
xdebug.dump_once => On => On  
xdebug.dump_undefined => Off => Off  
xdebug.extended_info => On => On  
xdebug.file_link_format => no value => no value  
xdebug.force_display_errors => Off => Off  
xdebug.force_error_reporting => 0 => 0  
xdebug.halt_level => 0 => 0  
xdebug.idekey => PHPSTORM => PHPSTORM  
xdebug.max_nesting_level => 256 => 256  
xdebug.max_stack_frames => -1 => -1  
xdebug.overload_var_dump => On => On  
xdebug.profiler_aggregate => Off => Off  
xdebug.profiler_append => Off => Off  
xdebug.profiler_enable => On => On  
xdebug.profiler_enable_trigger => Off => Off  
xdebug.profiler_enable_trigger_value => no value => no value  
xdebug.profiler_output_dir => /tmp => /tmp  
xdebug.profiler_output_name => cachegrind.out.%p => cachegrind.out.%p  
xdebug.remote_addr_header => no value => no value  
xdebug.remote_autostart => On => On  
xdebug.remote_connect_back => On => On  
xdebug.remote_cookie_expire_time => 3600 => 3600  
xdebug.remote_enable => On => On  
xdebug.remote_handler => dbgp => dbgp  
xdebug.remote_host => 192.168.9.12 => localhost  
xdebug.remote_log => /xdebug.log => /xdebug.log  
xdebug.remote_mode => req => req  
xdebug.remote_port => 9000 => 9000  
xdebug.scream => Off => Off  
xdebug.show_error_trace => On => On  
xdebug.show_exception_trace => Off => Off  
xdebug.show_local_vars => Off => Off  
xdebug.show_mem_delta => Off => Off  
xdebug.trace_enable_trigger => Off => Off  
xdebug.trace_enable_trigger_value => no value => no value  
xdebug.trace_format => 0 => 0  
xdebug.trace_options => 0 => 0  
xdebug.trace_output_dir => /tmp => /tmp  
xdebug.trace_output_name => trace.%c => trace.%c  
xdebug.var_display_max_children => 128 => 128  
xdebug.var_display_max_data => 512 => 512  
xdebug.var_display_max_depth => 3 => 3  

Is there any thing else I can do to debug this a little bit better, any other xdebug settings I should try ?

Thanks,

Warren

  • 写回答

1条回答 默认 最新

  • dongzhiyong8577 2015-11-12 20:47
    关注

    For anyone interested, the wrong php.ini file was being modified. I was blindly modifying /etc/php5/cli/php.ini instead of /etc/php5/apache2/php.ini. I was wondering what that "cli" in the path meant.

    Thanks,

    Warren

    评论

报告相同问题?

悬赏问题

  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序