使用触发值的 xdebug 跟踪和分析器文件

xdebug trace and profiler files using trigger value

关于 xdebug.trace_enable_trigger_value:"This setting can be used to restrict who can make use of the XDEBUG_TRACE functionality as outlined in xdebug.trace_enable_trigger. When changed from its default value of an empty string, the value of the cookie, GET or POST argument needs to match the shared secret set with this setting in order for the trace file to be generated."(xdebug 文档)。相当于 xdebug.profiler_enable_trigger_value

我有 xdebug 2.2.3,这个在 php.ini 中:

xdebug.trace_enable_trigger=1
xdebug.trace_enable_trigger_value="miko"

但是如果我将任何东西作为 XDEBUG_TRACE 参数的值传递(无论是通过 get 参数还是通过 cookie),它仍然会生成跟踪文件。那么我怎样才能让这个触发值真正起作用呢?

你需要将你的 xdebug 升级到高于 v2.3 才能工作,来自文档:

xdebug.trace_enable_trigger_value
Type: string, Default value: "", Introduced in Xdebug >= 2.3
This setting can be used to restrict who can make use of the XDEBUG_TRACE functionality as outlined in xdebug.trace_enable_trigger. When changed from its default value of an empty string, the value of the cookie, GET or POST argument needs to match the shared secret set with this setting in order for the trace file to be generated.