问题描述
XDebug 提供配置指令 xdebug.profiler_enable_trigger 允许通过传递 GET 或 POST 参数XDEBUG_PROFILE"来激活分析.通过 HTTP 调用脚本时.如果您不想分析所有脚本,而只想分析少数特殊情况而不总是更改 PHP 配置,这会很方便.
XDebug offers the configuration directive xdebug.profiler_enable_trigger that allows to activate profiling by passing the GET or POST parameter "XDEBUG_PROFILE" when calling a script via HTTP. This is handy if you don't want profiling for ALL of your scripts but only for a few special cases without always changing your PHP configuration.
有没有办法为命令行 PHP 程序实现相同的行为?我试图将 XDEBUG_PROFILE 作为命令行参数传递,但没有奏效.
Is there a way to achieve the same behavior for command line PHP programs? I tried to pass the XDEBUG_PROFILE as a command line argument but it didn't work.
总的来说,分析命令行 PHP 效果很好,但我希望具有与浏览器和 HTTP 服务器相同的每次调用灵活性.
In general, profiling command line PHP works well, but I'd like to have the same per-call-flexibility as with a browser and HTTP server.
推荐答案
您可以使用 -d 标志传递 INI 设置:php -d xdebug.profiler_enable=On script.php代码>.
You can pass INI settings with the -d flag: php -d xdebug.profiler_enable=On script.php.
这篇关于如何为命令行 PHP 脚本触发 XDebug 分析器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!



大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)