Xdebug Profiler创建一个cachegrind.自动附加文件的输出文件,而不是目标文件


Xdebug Profiler creates a cachegrind.out file for auto-prepended file but not the target file

Looking to profile my web app, I have added the following settings to my Applications php.ini file:

zend_extension                  = "C:'hqp'xampp_1.7.4'php'ext'php_xdebug.dll"
xdebug.profiler_append          = 0
xdebug.profiler_enable          = 1 
xdebug.profiler_output_dir      = "c:'hqp'xampp_1.7.4'tmp'profiles"
xdebug.profiler_output_name     = "cachegrind.out.%s"
xdebug.profiler_enable_trigger  = 1

在httpd.conf文件中,使用php值auto_prepend自动添加文件。生成的cachegrind.out.*文件具有此文件的名称(xdebug.profiler_output_name中的%s修饰符),而不是我实际要配置的文件(例如index.php文件没有相应的cachegrind.out.filepath_index.php)

你知道我错过了什么吗?

可能您正在生成两个文件,第二个文件覆盖了第一个文件。

您可以在php.ini中更改以下参数:

xdebug.profiler_append=1

这应该在同一个文件中附加两个调用。来源:https://xdebug.org/docs/profiler

xdebug.profiler_output_name = cachegrind.out.%u.%p.%r

这应该确保如果有两个文件,它们的名称应该不同。

https://xdebug.org/docs/all_settings#trace_output_name查看其他修饰符