Xdebug is a great tool for debugging our PHP code, but another thing it does very well is help us find bottlenecks in our applications. For instructions on installing xDebug you can see my article Debugging PHP code with xDebug.
Enabling the profiler
We can tell xDebug to profile our code by adding this in our php.ini file:
1 2 xdebug.profiler_enable = 1 xdebug.profiler_output_dir = '/path/to/folder/'
xdebug.profiler_output_dir is the folder where xDebug will dump the profile information. Make sure this folder is writable by apache or you won’t see any file generated in that folder.