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 2w 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 31% 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

2752d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/45391686?v=4)[GE](/maintainers/binfer)[@binfer](https://github.com/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

[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)
