PHPackages                             binfer/php-xh - 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. binfer/php-xh

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

binfer/php-xh
=============

A example xhprof package

1(7y ago)03PHPPHP &gt;=5.3.3

Since Dec 19Pushed 7y agoCompare

[ Source](https://github.com/binfer-php/xh)[ Packagist](https://packagist.org/packages/binfer/php-xh)[ RSS](/packages/binfer-php-xh/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

To begin with, you need to install the XHProf extension. Refer to the [PHP documentation](http://www.php.net/manual/en/xhprof.setup.php) if you need assistance.

You will need to manually create the database and populate it with the provided scheme. The database scheme is located at `/setup/database.sql`.

Rename the `/xhprof/includes/config.inc.sample.php` to `/xhprof/includes/config.inc.php`. There are only two supported parameters.

- `xhprof_url` is the URL to the XHProf.io library.
- `pdo` is the PDO instance. This library uses [PDO](http://uk3.php.net/pdo) to handle all of the database operations.
- `enable` is a closure to control when enable data collection, return true means always enable

Some cases for reference:

Alway enable

```
'enable' => function() {
     return true;
}
```

Enable if url contents `debug` parameter:

```
'enable' => function() {
    if (!empty($_GET['debug'])) {
        return true;
    }
}
```

Enable for 1/100 probability

```
'enable' => function() {
    return rand(0, 100) === 42;
}
```

Enable for url path is `/`:

```
'enable' => function() {
    if (parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) === '/') {
        return true;
    }
}
```

For XHProf.io to start collecting data, you need `/inc/inject.php` files included to every file of interest. The recommended approach is to update your `php.ini` configuration to automatically prepend and append these files.

```
auto_prepend_file = /[absolute path to xhprof.io]/inc/inject.php

```

If you use nginx, you could configuration `auto_prepend_file` as a `fastcgi_param`

```
fastcgi_param  PHP_VALUE "auto_prepend_file=/[absolute path to xhprof.io]/inc/inject.php";

```

If you are using PHP-FPM, then XHProf.io will utilise `fastcgi_finish_request` to hide any overhead related to data collection. There is nothing to worry about if you are not using PHP-FPM either, as the overhead is less than a few milliseconds.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2704d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b8d502e1d389030cc5860ed293ad0a1cbda5578bfb3335bd6195a0479ecbc4e5?d=identicon)[binfer](/maintainers/binfer)

---

Top Contributors

[![binfer](https://avatars.githubusercontent.com/u/45391686?v=4)](https://github.com/binfer "binfer (4 commits)")

### Embed Badge

![Health badge](/badges/binfer-php-xh/health.svg)

```
[![Health](https://phpackages.com/badges/binfer-php-xh/health.svg)](https://phpackages.com/packages/binfer-php-xh)
```

###  Alternatives

[symfony/stopwatch

Provides a way to profile code

2.8k387.2M918](/packages/symfony-stopwatch)[fruitcake/laravel-debugbar

PHP Debugbar integration for Laravel

19.1k662.9k29](/packages/fruitcake-laravel-debugbar)[spatie/ignition

A beautiful error page for PHP applications.

510147.6M69](/packages/spatie-ignition)[jokkedk/webgrind

Webgrind is a Xdebug profiling web frontend in PHP5. It implements a subset of the features of kcachegrind and installs in seconds and works on all platforms. For quick'n'dirty optimizations it does the job.

3.3k193.0k](/packages/jokkedk-webgrind)[koriym/printo

An object graph visualizer.

1421.8M2](/packages/koriym-printo)[soloterm/dumps

A Laravel command to intercept dumps from your Laravel application.

125285.7k3](/packages/soloterm-dumps)

PHPackages © 2026

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