PhpStorm捕获应跳过的请求(xdebug.remote_autostart = 0)

问题描述 投票:0回答:1

如果存在GET / POST / COOKIE变量,我将Xdebug配置为启动远程调试会话:xdebug.remote_autostart=0。但是PhpStorm会在每个请求上激活调试,而与变量无关。

PhpStorm配置:

  • 在PHP脚本的第一行中断:
  • 未指定路径映射时在第一行强制中断:
  • 当脚本不在项目外部时,在第一行强制中断:关闭

Xdebug配置:

xdebug support => enabled
Support Xdebug on Patreon, GitHub, or as a business: https://xdebug.org/support
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.file_link_format => no value => no value
xdebug.filename_format => no value => no value
xdebug.force_display_errors => Off => Off
xdebug.force_error_reporting => 0 => 0
xdebug.gc_stats_enable => Off => Off
xdebug.gc_stats_output_dir => /tmp => /tmp
xdebug.gc_stats_output_name => gcstats.%p => gcstats.%p
xdebug.halt_level => 0 => 0
xdebug.idekey => PHPSTORM => PHPSTORM
xdebug.max_nesting_level => 500 => 500
xdebug.max_stack_frames => -1 => -1
xdebug.overload_var_dump => 2 => 2
xdebug.profiler_append => Off => Off
xdebug.profiler_enable => Off => Off
xdebug.profiler_enable_trigger => On => On
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 => Off => Off
xdebug.remote_connect_back => On => On
xdebug.remote_cookie_expire_time => 3600 => 3600
xdebug.remote_enable => On => On
xdebug.remote_host => localhost => localhost
xdebug.remote_log => /var/www/public/var/log/xdebug.log => /var/www/public/var/log/xdebug.log
xdebug.remote_log_level => 7 => 7
xdebug.remote_mode => req => req
xdebug.remote_port => 9000 => 9000
xdebug.remote_timeout => 200 => 200
xdebug.scream => Off => Off
xdebug.show_error_trace => Off => Off
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

[$_GLOBAL from PhpStorm:

array (
  '_GET' => 
  array (
  ),
  '_POST' => 
  array (
  ),
  '_COOKIE' => 
  array (
  ),
  '_FILES' => 
  array (
  ),
  '_SERVER' => 
  array (
    'HOSTNAME' => '*****',
    'PUPPET_AGENT_VERSION' => '6.10.0',
    'PWD' => '/var/www/public',
    'PHPFPM_USER' => '1000',
    'XDEBUG_CONFIG' => 'remote_host=',
    'HOME' => '/var/www',
    'PHP_IDE_CONFIG' => 'serverName='*****',
    'NR_INSTALL_APP' => '\'PHP Application\'',
    'CODENAME' => 'stretch',
    'SHLVL' => '0',
    'APPLICATION_MODE' => 'development',
    'NR_INSTALL_KEY' => '\'\'',
    'PATH' => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
    'R10K_VERSION' => '3.3.2',
    'DEBIAN_FRONTEND' => 'noninteractive',
    'USER' => 'www-data',
    'HTTP_TE' => 'trailers',
    'HTTP_UPGRADE_INSECURE_REQUESTS' => '1',
    'HTTP_DNT' => '1',
    'HTTP_ACCEPT_ENCODING' => 'gzip, deflate, br',
    'HTTP_ACCEPT_LANGUAGE' => 'en-US,en;q=0.5',
    'HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
    'HTTP_USER_AGENT' => 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0',
    'HTTP_HOST' => ''*****',
    'REDIRECT_STATUS' => '200',
    'SERVER_NAME' => ''*****',
    'SERVER_PORT' => '443',
    'SERVER_ADDR' => ''*****,
    'REMOTE_PORT' => '41162',
    'REMOTE_ADDR' => ''*****',
    'SERVER_SOFTWARE' => 'nginx/1.17.4',
    'GATEWAY_INTERFACE' => 'CGI/1.1',
    'HTTPS' => 'on',
    'REQUEST_SCHEME' => 'https',
    'SERVER_PROTOCOL' => 'HTTP/2.0',
    'DOCUMENT_ROOT' => '/var/www/public/pub',
    'DOCUMENT_URI' => '/index.php',
    'REQUEST_URI' => '/',
    'SCRIPT_NAME' => '/index.php',
    'CONTENT_LENGTH' => '',
    'CONTENT_TYPE' => '',
    'REQUEST_METHOD' => 'GET',
    'QUERY_STRING' => '',
    'SCRIPT_FILENAME' => '/var/www/public/pub/index.php',
    'MAGE_RUN_CODE' => 'fr_FR',
    'MAGE_RUN_TYPE' => 'store',
    'PHP_VALUE' => 'memory_limit=768M 
 max_execution_time=18000',
    'PHP_FLAG' => 'session.auto_start=off 
 suhosin.session.cryptua=off',
    'FCGI_ROLE' => 'RESPONDER',
    'PHP_SELF' => '/index.php',
    'REQUEST_TIME_FLOAT' => 1586156187.1087,
    'REQUEST_TIME' => 1586156187,
  ),
  '_REQUEST' => 
  array (
  ),
  '_ENV' => 
  array (
  ),
)
php phpstorm xdebug php-7.3
1个回答
0
投票

您在'XDEBUG_CONFIG' => 'remote_host='输出下有$_SERVER,该输出通常是通过环境变量设置的(我假设您在此处使用某些Docker容器或类似的东西)。

如果存在XDEBUG_CONFIG环境变量,则Xdebug会将请求视为存在标准“ debug me”标志(GET / POST / COOKIE)。您可以在Xdebug文档中查看更多信息:https://xdebug.org/docs/remote


在相关说明上(不是您的情况,因为您的变量不为空),但我仍然认为仍然值得一提:https://bugs.xdebug.org/view.php?id=1608

© www.soinside.com 2019 - 2024. All rights reserved.