Xdebug Profiler Files Not In xdebug.profiler_output_dir

Published: January 17, 2019

Tags:

Something that’s tripped up both myself and devs that I’ve worked with is not finding Xdebug profiler files in the expected directory (/tmp by default).

It usually goes something like this…

This may be accompanied by running a sanity check, only to be accompanied by more hair pulling…

$ php -r 'var_dump(ini_get("xdebug.profiler_output_dir"));'
string(4) "/tmp"

If you find yourself in this situation, the likely cause is that your system is using PrivateTmp.

In this case the cachegrind file will actually be placed in a folder like this:

/tmp/systemd-private-ff40cf656c534501b9735e4b53c9bcd3-php-fpm.service-4C70G0/tmp/

The best way to find the file in this case is as follows:

sudo find /tmp/ -name '*cachegrind*'

Max Chadwick Hi, I'm Max!

I'm a software developer who mainly works in PHP, but also dabbles in Ruby and Go. Technical topics that interest me are monitoring, security and performance.

During the day I solve challenging technical problems at Something Digital where I mainly work with the Magento platform. I also blog about tech, work on open source and hunt for bugs.

If you'd like to get in touch with me the best way is on Twitter.