I have installed x-debug on local, got the vs-code extension however, I am now trying to enabling profiling as I have a performance issue on my WordPress site and want to identify what it is exactly.
I have been trying to modify the php.ini.hbs file in order to get the logs appearing in the /logs directory under a file name such as cachegrind.out.* however this is not working.
This is what I have added to the php.ini.hbs file
[xdebug]
Hi @sigurdwattdev! When you’re making changes to php.ini.hbs you have to save them and then Stop and Restart your site so that Local can recompile any changes. Have you tried that?
We also have a guide that goes over some performance troubleshooting here:
Additionally, there are some plugins mentioned in this article as well that can be useful for investigating resource hogs for example if you have a memory leak:
Yes I restarted it multiple times. Can you check the config which i have in that file to ensure that it is fine ? And if you have a config that you know works would be great to see that.
Darwin Sigurds-MacBook-Pro-2.local 23.6.0 Darwin Kernel Version 23.6.0: Fri Nov 15 15:13:28 PST 2024; root:xnu-10063.141.1.702.7~1/RELEASE_X86_64 x86_64
Here’s a php.ini.hbs config that works for me to generate profiler output, @sigurdwattdev.
Just as you suspected, it’s important to only edit the php.ini.hbs file. The php.ini itself gets regenerated on site start based on the contents of the .hbs version, so any edits you make directly to php.ini are overwritten.