I faced this problem while using xhprof and php-fpm on centos 7.
If you use php-fpm daemon configured to use private tmp directory (set to true by default in centos 7) and set xhprof.output_dir as subdirectory of /tmp, you probably notice than reports files can't be saved to that dir.
In that case you get the following message: "PHP Warning: fopen(/tmp/xhprof/58ed54f13807d.xhprof_testing.xhprof): failed to open stream: No such file or directory in /usr/share/pear/xhprof_lib/utils/xhprof_runs.php on line 136".
This happens because of php-fpm service cleans up /tmp directory each time the service started/restarted. So you have to create all subdirectories into /tmp each time you restart php-fpm.
$ sudo ls /tmp/systemd-private-b5096469cfb44152913c896b78570a6d-php-fpm.service-lP5PdF/tmp/xhprof
58f35870bd648.xhprof_testing.xhprof
$ sudo systemctl restart php-fpm
$ sudo ls /tmp/systemd-private-b5096469cfb44152913c896b78570a6d-php-fpm.service-EqBde7/tmp/xhprof
ls: cannot access /tmp/systemd-private-b5096469cfb44152913c896b78570a6d-php-fpm.service-EqBde7/tmp/xhprof: No such file or directory
I faced this problem while using xhprof and php-fpm on centos 7.
If you use php-fpm daemon configured to use private tmp directory (set to true by default in centos 7) and set
xhprof.output_dir
as subdirectory of/tmp
, you probably notice than reports files can't be saved to that dir. In that case you get the following message: "PHP Warning: fopen(/tmp/xhprof/58ed54f13807d.xhprof_testing.xhprof): failed to open stream: No such file or directory in /usr/share/pear/xhprof_lib/utils/xhprof_runs.php on line 136". This happens because of php-fpm service cleans up/tmp
directory each time the service started/restarted. So you have to create all subdirectories into/tmp
each time you restart php-fpm.Example: