【问题标题】:XDEBUG to always run, not only on GET requestXDEBUG 始终运行,不仅在 GET 请求上
【发布时间】:2017-01-04 14:48:53
【问题描述】:

标题不是我最好的;我想知道每次在本地服务器上执行脚本时如何运行XDEBUG,我可以访问您需要的所有配置文件,并且我有XDEBUG for PHP 目前正在愉快地运行。

唯一的事情是它只在有一个GET 请求形成时运行,其中XDEBUG_PROFILE 的键设置为true,或者只是设置,并且当前使用我正在开发的框架,

  1. 框架不允许在 URL 中扩展 GET 请求,只能显示与 slug 相关的数据,并且

  2. 1234563 ,这提供了难以筛选的数据。

所以我认为能够在每个脚本上触发 XDEBUG 是一个智能的想法,同时我在框架上进行开发以获得性能记录等等……

我在php.ini 中的当前XDEBUG 配置:

[XDebug]
;;;;;;;;;;;;;;;;;;

extension=php_xdebug.dll
xend_extension_ts="C:/xampp/apache/modules/php_xdebug-2.4.1-5.6-vc11.dll"

zend_extension = "\xampp\php\ext\php_xdebug.dll"
xdebug.collect_vars = 1
xdebug.show_local_vars = 1
xdebug.collect_params = 4
xdebug.remote_enable = 1
xdebug.remote_connect_back = 1

xdebug.profiler_enable = 1
xdebug.profiler_output_dir = "\xampp\tmp\"
xdebug.profiler_output_name = "cachegrind.out.%u.%R"
xdebug.profiler_enable_trigger = 1

xdebug.remote_host=127.0.0.1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp

我试图搜索它,但唯一的教程是如何实际设置 XDEBUG 本身,我已经完成了,我认为更改的变量将是 xdebug.profiler_enable_trigger = 1,但不完全确定。

提前致谢!

【问题讨论】:

    标签: php xdebug


    【解决方案1】:

    对于 Xdebug 2.x 将此行添加到您的 php.ini:

    xdebug.remote_autostart = 1
    

    通常您需要使用特定的 HTTP GET/POST 变量来启动远程调试(请参阅远程调试)。当此设置设置为 1 时,Xdebug 将始终尝试启动远程调试会话并尝试连接到客户端,即使 GET/POST/COOKIE 变量不存在。

    https://xdebug.org/docs/remote

    对于 Xdebug 3.x

    xdebug.start_with_request = yes
    

    从 2.x -> 3.x 迁移时,您还必须更改其他设置,see here。例如remote_host 被重命名为client_host

    【讨论】:

      猜你喜欢
      • 2017-05-12
      • 2014-09-28
      • 2016-03-29
      • 2012-03-01
      • 2019-01-07
      • 2019-04-12
      • 1970-01-01
      • 2020-05-05
      • 1970-01-01
      相关资源
      最近更新 更多