XHProf / PHP

See every requestand its slow function

Capture function timings and memory into Redis, then open the browser for a flame graph.

Little Flame, the xhprof project pet

A request comes in and the report writes itself

The entry class checks the path before a request starts and takes over report pages or static assets; business requests are profiled by the xhprof extension for function timings and memory.

Core reaches frameworks through five contracts, twelve integrations each provide adapters, samples land in Redis, and the report page renders from that one store.

  • Twelve framework integrations
  • Flame graphs and diagnoses
  • Token, Basic and allowlist
12Frameworks
13UI languages
v3.10.0Version
Little Flame Smile expression

Yanyan

A small orange-red flame on a light gray circular background, its tip tilted and forked, with a smiling face and rosy cheeks.

A flicker reveals slow functions.

From sampling to the bottleneck

Reports, comparison, export and auth all ship in the package.

Request-level sampling

The entry class wraps the request, samples business logic and stops in finally to persist.

Server-side flame graphs

Render by time, CPU or memory, and click a function to drill into its calls.

Two-run comparison

Tick exactly two runs and compare improvements and regressions in time order.

Six diagnostic rules

Lists suspicious functions by self time, call count, recursion and memory concentration.

Report authentication

auth_token, HTTP Basic, IP allowlist and trusted proxies add layered limits.

Export and alerts

Export three views as JSON or CSV, and POST slow requests to a webhook.

Sampling capabilities, filled in step by step

Versions and dates come from the CHANGELOG and git tags.

v3.10.0

Mascot forms via the Mascot API

Mascot::forms() lists the pet and twelve expressions; the report page also fixes invalid assets_url and empty-metric runs.

v3.9.0

CLI and queue sampling entry

xhprof:profile registers automatically; four Laravel queue events start and stop per message, covering non-HTTP entry points.

v3.8.0

Sampling, auth and export expand

Adds triggered sampling, Basic auth, IP allowlist, per-minute budget, slow-request webhook and JSON/CSV export.

v3.7.0

Pet icon and run comparison

The report page gets a little flame icon, a two-run comparison entry and proportional sampling.

Changelog

Recent releases; the full list is on GitHub Releases.

Latest v3.10.0 All versions
v3.10.02026-10-19

Mascot forms via the Mascot API, plus fixes for assets_url and empty-metric runs.

v3.9.02026-10-04

CLI and queue sampling entries, with report export, comparison and flame graph legend updates.

v3.8.02026-10-04

Triggered sampling, Basic auth, IP allowlist, budget, webhook and flame graphs.

v3.7.02026-10-03

Little flame pet icon, two-run comparison and proportional sampling.

v3.6.02026-09-29

Adds Yii2 as the twelfth compatible framework.

v3.5.02026-09-25

Adds native PHP without a framework as the eleventh integration.

Install and use

Install first, then mount the middleware for your first report.

PHP >= 8.0 / xhprof + RedisFull README
Install
composer require aaron-dev/xhprof-webman
Minimal example
// config/middleware.php
use ErikWang2013\Xhprof\Webman\XhprofMiddleware;

return [
    '' => [
        XhprofMiddleware::class,
    ],
];

// 产生一次请求后访问 /xhprof 查看报告

Twelve moods of Yanyan

Hover for a moment and its mood changes.

Search this site

Try “upload”, “migration” or “JWT”.