Xdebug is working with my containers. I can use the debugger to step through the code.
I have the following settings in xdebug.ini:
xdebug.client_host=host.docker.internal
xdebug.discover_client_host=0
xdebug.mode=develop,debug
xdebug.start_with_request=trigger
xdebug.idekey=PHPSTORM
xdebug.output_dir=/app
When I want to trigger Xdebug when I'm hitting an endpoint I just add:
?XDEBUG_SESSION_START=PHPSTORM
in the CLI I do:
export XDEBUG_TRIGGER=1
and then call the a script.
Now my question is how can I trigger the profiler without changing anything in the xdebug.ini.
Just have a one off session where the profiler produces a cachegrind file.
I've tried adding XDEBUG_TRIGGER=profile
to the query string but with no result.
Note, I understand that I can go to the ini add profile
to xdebug.mode=develop,debug,profile
(adding profile to the list), restart the container and then that will produce the cachegrind.
What I'm really asking is how can I do this via some environment variable with the need to change any setting or restart the server.