Git Product home page Git Product logo

Comments (11)

er361 avatar er361 commented on August 28, 2024 2

бля ну неужели так тяжело написать нахуй инструкцию по пользованию

from laravel-xhprof.

wdda avatar wdda commented on August 28, 2024 1

@emil-nasso @er361

How I configured this package to work:

PHP 7.2 (this for my old project)
Debian 9
Nginx
Laravel 5.8
Xhprof 2.2

  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
  1. Restart PHP:
    sudo systemctl restart fp2-php72-fpm.service

  2. 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

  3. Create config xhprof.php to Laravel in 'app' dir (if empty):

<?php
return [
    'path' => base_path('../xhprof.domain.ru/xhprof-0.9.4'),
    'enabled' => true,
    'freq' => 1
];
  1. Reload page Laravel site and go to xhprof.domain.ru

Enjoy!

from laravel-xhprof.

rez1dent3 avatar rez1dent3 commented on August 28, 2024

Hello.

What does it do?
How do you enable it?

Does it have a built-in viewer/client?

from laravel-xhprof.

rez1dent3 avatar rez1dent3 commented on August 28, 2024

@er361
Hello. There are no instructions. Install the package and install extension xhprof on the server. Everything works out of the box.

--
Привет. Вся инструкция сводится к composer req bavix/laravel-xhprof и установке xhprof. Всё работает из коробки.

from laravel-xhprof.

wdda avatar wdda commented on August 28, 2024

У меня не заработал этот пакет из коробки. Я установил расширение на сервер, настроил папку для хранения временных файлов. Временные файлы журнала не появляются, плюс ко всему непонятно как управлять данным расширением, как к примеру отключать или включать профилирование при надобности. Я заметил что Srvice Provider не интегрируется самостоятельно в app.php, но даже после ручного добавления провайдера, я не заметил чтобы пакет заработал. Ещё в коде пакета я увидел конфиг, а это означает, что какие-то настройки он всё же имеет, так может всё же, стоит описать более собранный путь того как на голом сервере с установленной Laravel использовать данный пакет?

Я использую:
Debian 9
Laravel 5.8
Xhprof 2.2

Ранее я неоднократно использовал Xhprof на текущем и других проектах, добавляя захват в index.php, но это не самый удобный способ из возможных. Я пока попробую поискать похожие пакеты.

from laravel-xhprof.

rez1dent3 avatar rez1dent3 commented on August 28, 2024

@wdda Thanks for the detailed instructions, I'll add it to the readme over the weekend. Or you can make a pull request.

from laravel-xhprof.

shcw avatar shcw commented on August 28, 2024

添加补充,cli模式下不可:

config/xhprof.php

<?php

return [
    'path'       => base_path('../xhprof.domain.ru/xhprof-0.9.4'),
    'enabled'    => true,
    'freq'       => 1,
    'flags'      => XHPROF_FLAGS_MEMORY | XHPROF_FLAGS_CPU,
    'output_dir' => '/tmp/xhprof',
    'run_id'     => date('YmdHis') . uniqid(),
];

from laravel-xhprof.

khanakia avatar khanakia commented on August 28, 2024

@rez1dent3 @wdda @Shencw
Still not working i followed the exact same docs. I believe we will have register the service provider first.
So how to make it work ?

from laravel-xhprof.

khanakia avatar khanakia commented on August 28, 2024

I figured it out
You need to addd \Bavix\XHProf\XHProfServiceProvider::class in /config/app.php

from laravel-xhprof.

khanakia avatar khanakia commented on August 28, 2024

@rez1dent3 On Packagist the pakcages is still showing 2.0.0 so how do i composer require bavix/laravel-xhprof the latest package which is 2.0.1 ?

https://packagist.org/packages/bavix/laravel-xhprof

from laravel-xhprof.

rez1dent3 avatar rez1dent3 commented on August 28, 2024

@khanakia Updated forcibly

from laravel-xhprof.

Related Issues (2)

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.