Coder Social home page Coder Social logo

laynefyc / php-monitor Goto Github PK

View Code? Open in Web Editor NEW
227.0 3.0 29.0 3.08 MB

A free, flexible, powerful tool that helps you monitor PHP Service and profiling PHP code.

PHP 87.17% HTML 11.73% CSS 1.10%
xhprof-ui php-profiler php-monitor uprofiler tideways xhprof swoole

php-monitor's Issues

在Nginx配置文件中配置fastcgi_param 不生效

php版本
PHP 7.3.1 (cli) (built: Feb 1 2019 12:26:46) ( NTS )

tideways版本
tideways => 4.1.7 Connection (tideways.connection) => unix:///var/run/tideways/tidewaysd.sock UDP Connection (tideways.udp_connection) => 127.0.0.1:8135 Default API Key (tideways.api_key) => Default Sample-Rate (tideways.sample_rate) => 20 Framework Detection (tideways.framework) => Service Name (tideways.service) => Automatically Start (tideways.auto_start) => Yes Tideways Collect Mode (tideways.collect) => tracing Tideways Monitoring Mode (tideways.monitor) => basic CLI Monitoring enabled (tideways.monitor_cli) => 0 Timeout for talk to Daemon (tideways.timeout) => 10000 Allowed Distributed Tracing Hosts (tideways.distributed_tracing_hosts) => 127.0.0.1 Load PHP Library (tideways.auto_prepend_library) => Yes Tideways.php found => No

nginx配置
image

image

在php.ini配置是可以的,但是全局起作用,希望在nginx对应项目配置,但是没数据产生,
希望大佬指点一下。

php5.6环境下登陆报错

/?r=login/account - Default value for parameters with a class type hint can only be NULL in /tmp/php-monitor/vendor/phpunit/phpunit/src/Framework/Assert/Functions.php on line 79

image

php5.6使用mysql保存数据出错

PHP 5.6.38 (cli) (built: Oct 15 2018 15:54:36)

doctrine/inflector         v1.1.0  Common String Manipulations with regard to casing and singular/plural rules.
illuminate/container       v5.4.36 The Illuminate Container package.
illuminate/contracts       v5.4.36 The Illuminate Contracts package.
illuminate/database        v5.4.36 The Illuminate Database package.
illuminate/events          v5.4.36 The Illuminate Events package.
illuminate/pagination      v5.4.36 The Illuminate Pagination package.
illuminate/support         v5.4.36 The Illuminate Support package.
jenssegers/mongodb         v2.3.5  A MongoDB based Eloquent model and Query builder for Laravel 4
kylekatarnls/update-helper 1.2.1   Update helper
nesbot/carbon              1.39.1  A simple API extension for DateTime.
paragonie/random_compat    v2.0.20 PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
symfony/polyfill-mbstring  v1.19.0 Symfony polyfill for the Mbstring extension
symfony/translation        v3.4.47 Symfony Translation Component


[12-Jan-2022 11:09:12 PRC] PHP Warning:  Missing argument 2 for Illuminate\Database\Eloquent\Model::setAttribute(), called in /data/php-monitor/vendor/illuminate/database/Eloquent/Concerns/HasAttributes.php on line 519 and defined in /data/php-monitor/vendor/illuminate/database/Eloquent/Concerns/HasAttributes.php on line 511
[12-Jan-2022 11:09:12 PRC] PHP Notice:  Undefined variable: value in /data/php-monitor/vendor/illuminate/database/Eloquent/Concerns/HasAttributes.php on line 519

pm\model\common\TraitModel
用save方法保存数据出错了

建议删除"天府三街"几个字

建议

可能是天府三街最好用的PHP非侵入式监控平台

修改为

更好用的PHP非侵入式监控平台

如果一定想带地区
那就

可能是东半球最好用的PHP非侵入式监控平台

php5.6安装后,导致项目无法正常访问

环境:php5.6 Composer version 1.10-dev
说明:
安装php-monitor时,composer.json修改php5.6的依赖版本,如下
"require": {
"php": "^5.6 || ^7.0",
"ext-json": "*",
"illuminate/database": "~5.2.0",
"jenssegers/mongodb": "~2.3.0",
"illuminate/pagination": "~5.2.0",

"kylekatarnls/laravel-carbon-2": "^1.0.0",
"nesbot/carbon": "2.16.3 as 1.34.0"
},
"suggest": {
"ext-xhprof": "You need to install either xhprof or uprofiler.",
"ext-uprofiler": "You need to install either xhprof or uprofiler.",
"ext-mongodb": "Mongo is needed to store profiler results.",
"ext-sqlite3": "sqlite3 is needed to store profiler results.",
"ext-pdo_mysql": "pdo_mysql is needed to store profiler results."
},
"autoload": {
"psr-4": {
"pm\": "src/"
}
},
"require-dev": {
"phpunit/phpunit": "~5.6.0"

用php5.6执行composer(系统中存在多个php)
php composer.phar --ignore-platform-reqs
数据库修改为mysql
访问php-monitor项目报错:信息如下:
2020/11/12 13:37:59 [error] 3392#0: *19274 FastCGI sent in stderr: "PHP message: PHP Parse error: syntax error, unexpected 'const' (T_CONST), expecting variable (T_VARIABLE) in /opt/test/monitor/php-monitor-1.0.1/vendor/nesbot/carbon/src/Carbon/CarbonInterface.php on line 501" while reading response header from upstream, client: XXX.XXX.XXX.XXX, server: XXX.XXX.XXX.XXX, request: "POST /?r=login/account HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-cgi-56.sock:", host: "XXX.XXX.XXX.XXX", referrer: "http://XXX.XXX.XXX.XXX:XX/assets/"

php5.6确实没法存储数据

刚开始是依赖版本的原因,在php5.6环境下会报错,后来更新了相应的依赖包到支持php5.6的版本,但是依然没法存储数据,通过调试发现 profile数据是已经拿到了,但是在save数据的时候没有成功,也没有任何错误抛出。
下面是我的依赖包的版本
"php": "^5.6",
"ext-json": "*",
"illuminate/database": "~5.3",
"illuminate/pagination": "~5.3"

在phalcon3.4.5 php7.3下使用报错

使用方式为:

//加载php-monitor监控系统 
require '/data/softdata/php-monitor/src/autoPrepend.php';

// 加载composer
require ROOT_PATH . '/composer/vendor/autoload.php';

访问项目:

<br />
<b>Notice</b>:  Trying to get property 'application' of non-object in <b>/data/web/github/phalcondemo/app/bootstrap/services.php</b> on line <b>47</b><br />
<br />
<b>Notice</b>:  Trying to get property 'viewsDir' of non-object in <b>/data/web/github/phalcondemo/app/bootstrap/services.php</b> on line <b>47</b><br />
<br />
<b>Fatal error</b>:  Uncaught Phalcon\Mvc\View\Exception: Views directory must be a string or an array in phalcon/mvc/view.zep:179
Stack trace:
#0 /data/web/github/phalcondemo/app/bootstrap/services.php(47): Phalcon\Mvc\View-&gt;setViewsDir(NULL)
#1 [internal function]: Closure-&gt;{closure}()
#2 [internal function]: Phalcon\Di\Service-&gt;resolve(NULL, Object(Phalcon\Di\FactoryDefault))
#3 [internal function]: Phalcon\Di-&gt;get('view', NULL)
#4 /data/web/github/phalcondemo/app/Sdks/Library/Helpers/DiHelper.php(24): Phalcon\Di-&gt;getShared('view')
#5 /data/web/github/phalcondemo/app/Sdks/Core/System/Flash/CustomFlash.php(51): App\Sdks\Library\Helpers\DiHelper::getShared('view')
#6 /data/web/github/phalcondemo/app/Sdks/Core/System/Flash/CustomFlash.php(85): App\Sdks\Core\System\Flash\CustomFlash-&gt;outputJson(Object(stdClass), -1, '\nError Code: 50...')
#7 /data/web/github/phalcondemo/app/bootstrap/exception_handler.php(58): App\Sdks\Core\System\Flash\CustomFlash-&gt;errorJson(Array, -1, '\nError Code: 50...')
#8 [internal function]: {closure}(Obje in <b>phalcon/mvc/view.zep</b> on line <b>179</b><br />
<br />
<b>Fatal error</b>:  Uncaught ArgumentCountError: Too few arguments to function Illuminate\Database\Eloquent\Model::setAttribute(), 1 passed in /data/web/github/phalcondemo/composer/vendor/illuminate/database/Illuminate/Database/Eloquent/Model.php on line 2476 and exactly 2 expected in /data/web/github/phalcondemo/composer/vendor/illuminate/database/Illuminate/Database/Eloquent/Model.php:2467
Stack trace:
#0 /data/web/github/phalcondemo/composer/vendor/illuminate/database/Illuminate/Database/Eloquent/Model.php(2476): Illuminate\Database\Eloquent\Model-&gt;setAttribute(Object(Carbon\Carbon))
#1 /data/web/github/phalcondemo/composer/vendor/illuminate/database/Illuminate/Database/Eloquent/Model.php(2912): Illuminate\Database\Eloquent\Model-&gt;setAttribute('', Object(Carbon\Carbon))
#2 /data/web/github/phalcondemo/composer/vendor/illuminate/database/Illuminate/Database/Eloquent/Model.php(1643): Illuminate\Database\Eloquent\Model-&gt;__set('', Object(Carbon\Carbon))
#3 /data/web/github/phalcondemo/composer/vendor/illuminate/database/Illuminat in <b>/data/web/github/phalcondemo/composer/vendor/illuminate/database/Illuminate/Database/Eloquent/Model.php</b> on line <b>2467</b><br />

php7.3,安装后,配置nginx后,报错.

第一个问题
扩展名字 最新的叫 tideways_xhprof.so
我修改了config.php

    //'extension' => 'tideways',
    'extension' => 'tideways_xhprof',

然后提示

Fatal error: Uncaught ArgumentCountError: Too few arguments to function 
Illuminate\Database\Eloquent\Model::setAttribute(), 1 passed in 
/data/web/easyphalcon/composer/vendor/illuminate/database/Illuminate/Database/Eloquent/Model.php on line 2476 and exactly 2 expected in 
/data/web/easyphalcon/composer/vendor/illuminate/database/Illuminate/Database/Eloquent/Model.php:2467 Stack trace: #0 /data/web/easyphalcon/composer/vendor/illuminate/database/Illuminate/Database/Eloquent/Model.php(2476): Illuminate\Database\Eloquent\Model->setAttribute(Object(Carbon\Carbon)) #1 
/data/web/easyphalcon/composer/vendor/illuminate/database/Illuminate/Database/Eloquent/Model.php(2912): Illuminate\Database\Eloquent\Model->setAttribute('', Object(Carbon\Carbon)) #2 
/data/web/easyphalcon/composer/vendor/illuminate/database/Illuminate/Database/Eloquent/Model.php(1643): Illuminate\Database\Eloquent\Model->__set('', Object(Carbon\Carbon)) #3 /data/web/easyphalcon/composer/vendor/illuminate/database/Illuminate/Database/Eloquent/Model.php(1615): Illum in /data/web/easyphalcon/composer/vendor/illuminate/database/Illuminate/Database/Eloquent/Model.php on line 2467

登录报错

[500]: /?r=login/account - Declaration of Illuminate\Container\Container::get($id) must be compatible with Psr\Container\ContainerInterface::get(string $id) in /usr/local/src/php-monitor/vendor/illuminate/container/Container.php on line 15

登录报错

用户得到授权,但是访问是被禁止的。

目前使用过程中发现了几个问题

首先感谢作者的项目,以下我是在使用过程中发现的几个问题。
使用环境

  • php版本7.2.33
  • xhprof版本2.2.3
  1. profiler enable 设置无效.
    $config['profiler']['enable']改为$config['profiler']['enable']()后修复
  2. 显示内存占用会出现负值情况
    image
  3. SQL耗时永远都是0μs

一些使用过程中发现的bug和优化

  1. url搜索条件不能使用部分匹配,添加like条件实现
    if(!empty($dto['url'])){
    $db->where('url','like',$dto['url']);
    }
  2. 分页跳转时会丢失其他参数,只包含分页条件。
    ?r=api/get-list&current=2&pageSize=20
    解决1 前端代码修复,需开放前端源码
    解决2 将搜索条件写入session

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.