XDEBUG 总是 运行,而不仅仅是 GET 请求
XDEBUG to always run, not only on GET request
这个标题不是我最好的;我想知道每次在本地服务器上执行脚本时如何 运行 XDEBUG
,我可以访问您需要的所有配置文件,并且我有 XDEBUG
PHP
运行现在很开心
唯一的问题是只有 运行s 当有 GET
请求时 XDEBUG_PROFILE
的键设置为 true,或者只是设置,并且当前框架我正在努力,
该框架不允许 URL 中的扩展 GET
请求,仅显示 slug-related 数据,并且
如果我尝试在框架上的文件中设置 $_GET['XDEBUG_PROFILE'] = true
,例如 Controller
,分析器会提供异常数据,并根据其他请求创建配置文件,例如favicon
负载等等,这给了难以筛选的数据。
所以我认为能够在每个脚本上触发 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
,但是不是很确定。
提前致谢!
for Xdebug 2.x 将此行添加到您的 php.ini
:
xdebug.remote_autostart = 1
Normally you need to use a specific HTTP GET/POST variable to start remote debugging (see Remote Debugging). When this setting is set to 1, Xdebug will always attempt to start a remote debugging session and try to connect to a client, even if the GET/POST/COOKIE variable was not present.
https://xdebug.org/docs/remote
用于 Xdebug 3.x
xdebug.start_with_request = yes
从 2.x -> 3.x 迁移时,您还必须更改其他设置 see here。例如 remote_host
被重命名为 client_host
.
这个标题不是我最好的;我想知道每次在本地服务器上执行脚本时如何 运行 XDEBUG
,我可以访问您需要的所有配置文件,并且我有 XDEBUG
PHP
运行现在很开心
唯一的问题是只有 运行s 当有 GET
请求时 XDEBUG_PROFILE
的键设置为 true,或者只是设置,并且当前框架我正在努力,
该框架不允许 URL 中的扩展
GET
请求,仅显示 slug-related 数据,并且如果我尝试在框架上的文件中设置
$_GET['XDEBUG_PROFILE'] = true
,例如Controller
,分析器会提供异常数据,并根据其他请求创建配置文件,例如favicon
负载等等,这给了难以筛选的数据。
所以我认为能够在每个脚本上触发 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
,但是不是很确定。
提前致谢!
for Xdebug 2.x 将此行添加到您的 php.ini
:
xdebug.remote_autostart = 1
Normally you need to use a specific HTTP GET/POST variable to start remote debugging (see Remote Debugging). When this setting is set to 1, Xdebug will always attempt to start a remote debugging session and try to connect to a client, even if the GET/POST/COOKIE variable was not present.
https://xdebug.org/docs/remote
用于 Xdebug 3.x
xdebug.start_with_request = yes
从 2.x -> 3.x 迁移时,您还必须更改其他设置 see here。例如 remote_host
被重命名为 client_host
.