Code Monkey home page Code Monkey logo

laravel-xhprof's Introduction

Laravel XHProf

Scrutinizer Code Quality Code Coverage Build Status Code Intelligence Status

Package Rank Latest Stable Version Latest Unstable Version License composer.lock

Laravel XHProf - Library for profiling in production.

  • Vendor: bavix
  • Package: Laravel XHProf
  • Version: Latest Stable Version
  • Laravel Version: 5.5, 5.6, 5.7, 5.8, 6.0, 7.0, 8.0
  • PHP Version: 7.1+
  • Composer: composer require bavix/laravel-xhprof

Get Started

  1. Install xhprof extension for PHP:
pecl install xhprof
  1. Add in php.ini or other included config (xhprof.ini):
extension=xhprof.so
xhprof.output_dir=/tmp/xhprof
  1. Restart PHP:
sudo systemctl restart fp2-php72-fpm.service
  1. 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
  1. Add domain for view results profiling (xhprof.domain.ru).

  2. 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
  1. Change root path in Nginx config for this domain: set $root_path /var/www/xhprof.domain.ru/xhprof-0.9.4/xhprof_html;

  2. Install this package:

composer req bavix/laravel-xhprof --dev
  1. Create config xhprof.php to Laravel in config dir (if empty):
<?php
return [
    'path' => base_path('../xhprof.domain.ru/xhprof-0.9.4'),
    'enabled' => true,
    'freq' => 1
];
  1. If you have old laravel (<=5.4), register the service provider by add this line \Bavix\XHProf\XHProfServiceProvider::class in your /config/app.php. If laravel 5.5 and older then skip this step.

  2. Reload page Laravel site and go to xhprof.domain.ru

Enjoy!

I wrote the instructions @wdda, thank you.


Supported by

Supported by JetBrains

laravel-xhprof's People

Contributors

bavixbot avatar dark-grey avatar dependabot[bot] avatar khanakia avatar mend-bolt-for-github[bot] avatar pavelsavushkinmix avatar peterverraedt avatar rez1dent3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

laravel-xhprof's Issues

How do you use this package?

Subject. โ˜๏ธ ๐Ÿ˜ƒ

What does it do?
How do you enable it?
Does it have a built-in viewer/client?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.