PHPackages                             bavix/laravel-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. bavix/laravel-xhprof

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

bavix/laravel-xhprof
====================

Quick profiling of your code for Laravel

2.1.0(1mo ago)22156.6k↓42.5%10MITPHPPHP &gt;=7.1CI passing

Since Aug 26Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/bavix/laravel-xhprof)[ Packagist](https://packagist.org/packages/bavix/laravel-xhprof)[ RSS](/packages/bavix-laravel-xhprof/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (19)Used By (0)

Laravel XHProf
==============

[](#laravel-xhprof)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/fda9cb2fb97f55208529aa27811436401a71ee0518d4f840bdb2c39fc3f7cdd8/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f62617669782f6c61726176656c2d786870726f662f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/bavix/laravel-xhprof/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/47d536172daa9c0ae388eaaa8f7f062bc3099accb9b47b8cb996d5ae19802f7e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f62617669782f6c61726176656c2d786870726f662f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/bavix/laravel-xhprof/?branch=master)[![Build Status](https://camo.githubusercontent.com/4036b95fe6dc9869e95e8bb637e437d6724b3e802d3173a29bbc8d42610b110d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f62617669782f6c61726176656c2d786870726f662f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/bavix/laravel-xhprof/build-status/master)[![Code Intelligence Status](https://camo.githubusercontent.com/4f9546a0a6228d089c3809d3a5c4460d14e90225858ea5fef01c0650db815feb/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f62617669782f6c61726176656c2d786870726f662f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d6173746572)](https://scrutinizer-ci.com/code-intelligence)

[![Package Rank](https://camo.githubusercontent.com/94ec6aa062cadfcf120cdad096f7581fbef1bfab32ea16a2071498b3bdb89e68/68747470733a2f2f7068707061636b616765732e6f72672f702f62617669782f6c61726176656c2d786870726f662f62616467652f72616e6b2e737667)](https://packagist.org/packages/bavix/laravel-xhprof)[![Latest Stable Version](https://camo.githubusercontent.com/c78b114aa51597c64ffe90a4f21e75ca64818661c73373d8a812dfbd75a946b0/68747470733a2f2f706f7365722e707567782e6f72672f62617669782f6c61726176656c2d786870726f662f762f737461626c65)](https://packagist.org/packages/bavix/laravel-xhprof)[![Latest Unstable Version](https://camo.githubusercontent.com/ed3076b754792fd340253d38e9c78c1c1d8ce2e445f11096050a9cbf282839e9/68747470733a2f2f706f7365722e707567782e6f72672f62617669782f6c61726176656c2d786870726f662f762f756e737461626c65)](https://packagist.org/packages/bavix/laravel-xhprof)[![License](https://camo.githubusercontent.com/e9eccedd8edd28209be17c5e52c0773a09b2dfbe3af6b815feef828e7b7574d7/68747470733a2f2f706f7365722e707567782e6f72672f62617669782f6c61726176656c2d786870726f662f6c6963656e7365)](https://packagist.org/packages/bavix/laravel-xhprof)[![composer.lock](https://camo.githubusercontent.com/c868b6cb1ffc20169ed762afcbff0c998971995a3786e35e00710e346397db99/68747470733a2f2f706f7365722e707567782e6f72672f62617669782f6c61726176656c2d786870726f662f636f6d706f7365726c6f636b)](https://packagist.org/packages/bavix/laravel-xhprof)

Laravel XHProf - Library for profiling in production.

- **Vendor**: bavix
- **Package**: Laravel XHProf
- **Version**: [![Latest Stable Version](https://camo.githubusercontent.com/c78b114aa51597c64ffe90a4f21e75ca64818661c73373d8a812dfbd75a946b0/68747470733a2f2f706f7365722e707567782e6f72672f62617669782f6c61726176656c2d786870726f662f762f737461626c65)](https://packagist.org/packages/bavix/laravel-xhprof)
- **Laravel Version**: `5.5`, `5.6`, `5.7`, `5.8`, `6.0`, `7.0`, `8.0`
- **PHP Version**: 7.1+
- **[Composer](https://getcomposer.org/):** `composer require bavix/laravel-xhprof`

### Get Started

[](#get-started)

1. Install xhprof extension for PHP:

```
pecl install xhprof
```

2. Add in php.ini or other included config (xhprof.ini):

```
extension=xhprof.so
xhprof.output_dir=/tmp/xhprof
```

3. Restart PHP:

```
sudo systemctl restart fp2-php72-fpm.service
```

4. Check XHProf in PHP Info:

```
php -i | grep xhprof
```

Result:

```
/opt/php72/conf.d/xhprof.ini,
xhprof
xhprof support => enabled
xhprof.collect_additional_info => 0 => 0
xhprof.output_dir => /tmp/xhprof => /tmp/xhprof
xhprof.sampling_depth => 2147483647 => 2147483647
xhprof.sampling_interval => 100000 => 100000
```

5. Add domain for view results profiling (xhprof.domain.ru).
6. Download library for view:

```
cd /var/www/xhprof.domain.ru;
wget http://pecl.php.net/get/xhprof-0.9.4.tgz
gzip -d xhprof-0.9.4.tgz
tar -xvf xhprof-0.9.4.tar
```

7. Change root path in Nginx config for this domain: `set $root_path /var/www/xhprof.domain.ru/xhprof-0.9.4/xhprof_html;`
8. Install this package:

```
composer req bavix/laravel-xhprof --dev
```

9. Create config xhprof.php to Laravel in `config` dir (if empty):

```
