Comments (11)
бля ну неужели так тяжело написать нахуй инструкцию по пользованию
from laravel-xhprof.
How I configured this package to work:
PHP 7.2 (this for my old project)
Debian 9
Nginx
Laravel 5.8
Xhprof 2.2
-
Install xhprof extension for PHP:
pecl install xhprof
-
Add in php.ini or other included config (xhprof.ini):
extension=xhprof.so
xhprof.output_dir=/tmp/xhprof
-
Restart PHP:
sudo systemctl restart fp2-php72-fpm.service
-
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
-
Add domain for view results profiling (xhprof.domain.ru).
-
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
-
Change root path in Nginx config for this domain:
set $root_path /var/www/xhprof.domain.ru/xhprof-0.9.4/xhprof_html;
-
Install this package:
composer req bavix/laravel-xhprof --dev
-
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
];
- Reload page Laravel site and go to xhprof.domain.ru
Enjoy!
from laravel-xhprof.
Hello.
What does it do?
How do you enable it?
- Install the extension and enable it: https://github.com/longxinH/xhprof
- Install the package and the logs are collected.
Does it have a built-in viewer/client?
- I am using this: https://github.com/longxinH/xhprof/tree/master/xhprof_html
from laravel-xhprof.
@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.
У меня не заработал этот пакет из коробки. Я установил расширение на сервер, настроил папку для хранения временных файлов. Временные файлы журнала не появляются, плюс ко всему непонятно как управлять данным расширением, как к примеру отключать или включать профилирование при надобности. Я заметил что Srvice Provider не интегрируется самостоятельно в app.php, но даже после ручного добавления провайдера, я не заметил чтобы пакет заработал. Ещё в коде пакета я увидел конфиг, а это означает, что какие-то настройки он всё же имеет, так может всё же, стоит описать более собранный путь того как на голом сервере с установленной Laravel использовать данный пакет?
Я использую:
Debian 9
Laravel 5.8
Xhprof 2.2
Ранее я неоднократно использовал Xhprof на текущем и других проектах, добавляя захват в index.php, но это не самый удобный способ из возможных. Я пока попробую поискать похожие пакеты.
from laravel-xhprof.
@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.
添加补充,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.
@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.
I figured it out
You need to addd \Bavix\XHProf\XHProfServiceProvider::class
in /config/app.php
from laravel-xhprof.
@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.
@khanakia Updated forcibly
from laravel-xhprof.
Related Issues (2)
- Request: Document HOT 16
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-xhprof.