xhprof icon indicating copy to clipboard operation
xhprof copied to clipboard

PHP 8.3

Open kickthemooon opened this issue 1 year ago • 3 comments

Screenshot 2024-10-18 at 08 16 56

Screenshot 2024-10-18 at 08 18 15

Screenshot 2024-10-18 at 08 20 05

I have seemingly managed to enable the extension and added the function in my index.php application entrypoint.

But, unfortunately, I'm not getting any output under /tmp/xhprof nor the directory itself.

Did anybody manage to get it working with PHP 8.3?

Is there something else I should do to enable it for FPM?

I also called it via the CLI bypassing FPM

env -i REDIRECT_STATUS=true \
  SCRIPT_NAME=index.php \
  SCRIPT_FILENAME=index.php \
  REQUEST_METHOD=GET \
  REQUEST_URI="/some-path" \
  SERVER_NAME="www.example.com" \
  cgi-fcgi -bind -connect 127.0.0.1:9000

The response comes back successfully but no profiling data under /tmp/xhprof nor the directory itself.

kickthemooon avatar Oct 18 '24 06:10 kickthemooon

Hey, i just saw this and am wondering if support for php 8.4 is in place or planned anytime soon, do you know? Thanks

Purpl3ttuce avatar Jan 15 '25 13:01 Purpl3ttuce

Hey, i just saw this and am wondering if support for php 8.4 is in place or planned anytime soon, do you know? Thanks

Of course, due to work delays, support for PHP 8.4 will be launched as soon as possible.

longxinH avatar Apr 02 '25 04:04 longxinH

It works fine even with PHP 8.4 with the latest fixes from #87.

But, unfortunately, I'm not getting any output under /tmp/xhprof nor the directory itself.

This extension doesn't output anything to that directory by default. You need to write custom code that pipes the output of xhprof_disable() to your desired location. See an example here:

https://github.com/longxinH/xhprof/blob/20b8caffe24cf942b9930b043aab79da6c913db8/examples/sample.php#L22-L26

That directory setting is used as a default for the included library and nothing else (which is confusing, I agree):

https://github.com/longxinH/xhprof/blob/20b8caffe24cf942b9930b043aab79da6c913db8/xhprof_lib/utils/xhprof_runs.php#L89-L95

kasparsd avatar Jun 28 '25 18:06 kasparsd