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.
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.
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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…