PHPackages                             houxiaobei/xhprof - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. houxiaobei/xhprof

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

houxiaobei/xhprof
=================

XHGUI is a GUI for the XHProf PHP extension, using a database backend, and pretty graphs to make it easy to use and interpret.

0130PHP

Since Nov 8Pushed 10y ago1 watchersCompare

[ Source](https://github.com/houxiaobei/xhprof)[ Packagist](https://packagist.org/packages/houxiaobei/xhprof)[ RSS](/packages/houxiaobei-xhprof/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

XHProf UI
=========

[](#xhprof-ui)

This is a graphical front end designed to store and present the profiling information provided by the Facebook created XHProf profiling tool.

Related Tools
-------------

[](#related-tools)

- [XHGui](https://github.com/perftools/xhgui) - Uses MongoDB as a backend (rather than MySQL)
- [XHProf.io](http://xhprof.io/) - Uses MySQL backend, more normalized storage schema

Project Includes
----------------

[](#project-includes)

- It includes a header.php document you can use with PHP's auto\_prepend\_file directive. It sets up profiling by initilizing a few variables, and settting register\_shutdown\_function with the footer. Once started profiles are done when requested (?\_profile=1), or randomly. Profiled pages display a link to their profile results at the bottom of the page (this can be disabled on a blacklist based for specific documents. e.g. pages generating XML, images, etc.).
- For tips on including header.php on an nginx + php-fpm install take a look at: [http://www.justincarmony.com/blog/2012/04/23/php-fpm-nginx-php\_value-and-multiple-values/](http://www.justincarmony.com/blog/2012/04/23/php-fpm-nginx-php_value-and-multiple-values/)
- The GUI is a bit prettier (Thanks to Graham Slater)
- It uses a MySQL backend, the database schema is stored in xhprof\_runs.php
- There's a frontend to view different runs, compare runs to the same url, etc.

Key Features
------------

[](#key-features)

- Listing 25, 50 most recent runs
- Display most expensive (cpu), longest running, or highest memory usage runs for the day
- It introduces the concept of "Similar" URLs. Consider:
    -
    - While the URLs are different, the PHP code execution path is likely identical, by tweaking the method in xhprof\_runs.php you can help the frontend be aware that these urls are identical.
- Highcharts is used to graph stats over requests for an easy heads up display.

Requirements
------------

[](#requirements)

Besides a simple PHP running on your favourite web server you will also need following packages:

- php5-xhprof
- php5-mysql
- graphviz (uses `dot` to generate callgraphs)

Installation
------------

[](#installation)

- Install your favourite mix of PHP and web server
- Install MySQL server
- Clone the project to some folder
- Map the sub folder `xhprof_html` to be accessible over HTTP
- Move `xhprof_lib/config.sample.php` to `xhprof_lib/config.php`
- Edit `xhprof_lib/config.php`
- Update the SQL server configuration
- Update the URL of the service (should point to `xhprof_html` over HTTP)
- Update the `dot_binary` configuration - otherwise no call graphs!
- Update the `controlIPs` variable to enable access.
- For a development machine you can set this to `false` to disable IP checks.
- Import the DB schema (it is just 1 table)
- See the SQL at [xhprof\_runs.php](https://github.com/toomasr/xhprof/blob/master/xhprof_lib/utils/xhprof_runs.php#L109)
- Add a PHP configuration to enable the profiling
- If using Apache you can edit your virtual host configuration
- Add `php_admin_value auto_prepend_file "/path/to/xhprof/external/header.php"`
- Visit [http://your-server/xhprof/xhprof\_html/](http://your-server/xhprof/xhprof_html/) and be amazed!
- To get profiler information showing up there visit your page with a `GET` variable `_profile=1`.
- For example `http://localhost/?_profile=1`

We Are Working On
-----------------

[](#we-are-working-on)

- The aggregation functionality is ignored completely
- The code is... a mess. Deadlines do that to you, we're working on it
- The default table schema isn't indexed all the places it needs to be
- Easier ways to diff URLs

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 68% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/76655353411c64ce50ea549fe5b927c28375bf05fd261f9785349f42acfb5583?d=identicon)[houxiaobei](/maintainers/houxiaobei)

---

Top Contributors

[![preinheimer](https://avatars.githubusercontent.com/u/244891?v=4)](https://github.com/preinheimer "preinheimer (174 commits)")[![jwpage](https://avatars.githubusercontent.com/u/52687?v=4)](https://github.com/jwpage "jwpage (17 commits)")[![dshafik](https://avatars.githubusercontent.com/u/58074?v=4)](https://github.com/dshafik "dshafik (15 commits)")[![bertrandmalet](https://avatars.githubusercontent.com/u/496453?v=4)](https://github.com/bertrandmalet "bertrandmalet (9 commits)")[![MarkViafoura](https://avatars.githubusercontent.com/u/123571331?v=4)](https://github.com/MarkViafoura "MarkViafoura (5 commits)")[![GromNaN](https://avatars.githubusercontent.com/u/400034?v=4)](https://github.com/GromNaN "GromNaN (3 commits)")[![russelldavis](https://avatars.githubusercontent.com/u/551404?v=4)](https://github.com/russelldavis "russelldavis (3 commits)")[![scoates](https://avatars.githubusercontent.com/u/71983?v=4)](https://github.com/scoates "scoates (3 commits)")[![spk](https://avatars.githubusercontent.com/u/98590?v=4)](https://github.com/spk "spk (3 commits)")[![hjr3](https://avatars.githubusercontent.com/u/33318?v=4)](https://github.com/hjr3 "hjr3 (2 commits)")[![christiaan](https://avatars.githubusercontent.com/u/118490?v=4)](https://github.com/christiaan "christiaan (2 commits)")[![beberlei](https://avatars.githubusercontent.com/u/26936?v=4)](https://github.com/beberlei "beberlei (2 commits)")[![pvolyntsev](https://avatars.githubusercontent.com/u/1147388?v=4)](https://github.com/pvolyntsev "pvolyntsev (1 commits)")[![ritmas](https://avatars.githubusercontent.com/u/3692760?v=4)](https://github.com/ritmas "ritmas (1 commits)")[![sebastianbergmann](https://avatars.githubusercontent.com/u/25218?v=4)](https://github.com/sebastianbergmann "sebastianbergmann (1 commits)")[![smalyshev](https://avatars.githubusercontent.com/u/155000?v=4)](https://github.com/smalyshev "smalyshev (1 commits)")[![tstarling](https://avatars.githubusercontent.com/u/389141?v=4)](https://github.com/tstarling "tstarling (1 commits)")[![willmacdonald](https://avatars.githubusercontent.com/u/14171?v=4)](https://github.com/willmacdonald "willmacdonald (1 commits)")[![xiian](https://avatars.githubusercontent.com/u/133872?v=4)](https://github.com/xiian "xiian (1 commits)")[![chrono](https://avatars.githubusercontent.com/u/76803?v=4)](https://github.com/chrono "chrono (1 commits)")

### Embed Badge

![Health badge](/badges/houxiaobei-xhprof/health.svg)

```
[![Health](https://phpackages.com/badges/houxiaobei-xhprof/health.svg)](https://phpackages.com/packages/houxiaobei-xhprof)
```

###  Alternatives

[fjogeleit/prometheus-messenger-middleware

Prometheus Middleware for the Symfony Messenger Component

2255.2k](/packages/fjogeleit-prometheus-messenger-middleware)[spatie/craft-ray

Easily debug CraftCMS projects

1638.6k](/packages/spatie-craft-ray)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
