Giter Site home page Giter Site logo

laynefyc / xhgui-branch Goto Github PK

View Code? Open in Web Editor NEW
894.0 35.0 126.0 2.22 MB

uprofiler UI,xhprof UI,tideways UI , PHP Non-intrusive performance monitoring platform.

Home Page: https://github.com/laynefyc/php-monitor

License: GNU General Public License v3.0

PHP 26.89% HTML 14.47% CSS 6.32% JavaScript 52.32%
xhgui php php7 xhprof tideways sql composer

xhgui-branch's Introduction

最新

新版本已开发完成,做了如下改进:

🌈 支持本地Sqlite存储,也支持MySQL和MongoDB存储。

🌍 国际化,支持英语/简体中文/繁体中文。

🛡 可通过Composer极速安装。

🎨 一句命令运行监控服务。

🌈 支持帐号密码登录。

更多新功能欢迎前往 https://github.com/laynefyc/php-monitor 体验。

历史

新版本已经在开发中,后端功能全部开发完成,前端页面开发还在努力中。由于前端技术更新太快,不打算jQuery一把梭了,新版本会用上vue或者react,所以我也是边学习边开发。

公众号写了有一段时间,里面的内容也充实了不少,相比博客质量更高一些,分享的内容更成体系,有兴趣的关注看看。

http://imgs.it2048.cn/code-log.png

提交Issue之前请看看 README.md(当前页面)和历史已经处理的 Closed Issue90%的问题都能找到答案。另外10%的问题请按照Issue模板中需要的信息提交,你提供的信息越多我越能给你准确的建议,不按照规范提交的Issue我会直接关闭。

2019年想定个目标 - 重写xhprof扩展和xhgui-branch,有兴趣的朋友请移步到我的博客留言交流一下 我的博客

获取底层信息的PHP扩展很多,比如 uprofiler,tideways_xhprof,tideways,xhprof等,他们的原理都一样,只是兼容性与稳定性的差别(选择一个安装,安装多个会冲突)。

Class 'MongoClient' not found
Fatal error: Call to undefined function xhprof_enable()

如出现上面的报错信息,请使用php -m 看看是否有tideways或者tideways_xhprof扩展。 再修改 config/config.default.php#L12 配置文件的扩展名。 如果还有问题请检查vendor 目录下是否存在 alcaeus/mongo-php-adapter扩展文件(这是一个兼容mongo.so和mongodb.so的适配器)。如果不存在请更新代码(git pull origin master),然后运行composer install安装。

90%的问题都能在 ISSUE 中找到答案 ISSUE

tideways的新版扩展已经更名,并且不支持SQL显示,建议使用支持SQL展示的V4版本 v4.1.6

如果一定要使用V5版本,请修改配置文件 config/config.default.php#L12 为 tideways_xhprof

已添加SQL列表与SQL执行时间展示(暂时只支持tideways扩展),下文有截图。

xhgui汉化与更新

xhgui的安装信息可到源项目查看文档:xhgui

如果不能安装成功可到我博客看这篇文章:Tideways和xhgui打造PHP非侵入式监控平台

当然最好的方式就是联系我,我的博客:https://blog.it2048.cn

Latest Stable Version Total Downloads Build Status

一. 站在举人的肩膀上

项目的汉化参考了 https://github.com/snfnwgi/xhgui,对部分翻译不够准确的词做了修改,对未翻译的部分做了翻译。

xhgui源项目已经很久不更新了。我在基于xhgui搭建PHP监控平台的过程中遇到很多问题,自己对PHP和前端都还算了解,打算边修边优化并将更新的代码开源。

二. 为什么不直接在源项目提交Merge Request?

我会将一些基本的语法Bug修复后提交Merge Request。但汉化的修改不会提,主要原因是xhgui源项目对代码的要求基本是可用就可的程度,后期扩展的添加混乱的一塌糊涂。维护代码的人也焦头烂额,很多显而易见的错误都没人修。我无法保证我提的代码被及时的采纳。xhgui的UI主要是针对老外设计的,很多符号和数据单位我看着不习惯,一些交互也不友好,这个项目主要会对这方面做改动所以不适合提交Merge Request。

三. 界面截图

首页截图 首页截图

瀑布图 瀑布图

函数监控图 函数监控图

SQL列表 SQL列表

四. 更新日志

  1. 将时间选择控件换成了更符合国人使用习惯的laydate;
  2. 将时间的格式转换成了 2017-06-08 12:18:18 格式;
  3. 将微妙转换成了毫秒,byte转换成了MB或者KB;
  4. 添加了IP的展示;
  5. 将中文URL做了url_decode();
  6. 将页面的大标题去掉,换成用颜色选中的Nav标签展示;
  7. 修复了『自定义函数』功能无法使用的问题;
  8. 翻译了大量英文描述;
  9. 很多小Tips等待有心人去发现;
  10. 支持composer更新;

五. TODO

  1. 将前端展示页面抽离出来;
  2. 支持多域名的显示;

六. 通过Composer安装&更新

composer require laynefyc/xhgui-chinese

七. 常见问题

  1. 如果数据显示不全,内存和执行等信息都是空,请排查PHP扩展程序,tideways和xhprof并不支持所有操作系统和所有PHP版本;
  2. 如果mongoDB中的数据是空,请检查mongoDB的配置,header.php文件的引入是否规范;
  3. 提交Issues请带上操作系统,PHP版本,扩展名和扩展版本。只提供一句话很难给你建议;
  4. 历史问题在这里 https://github.com/laynefyc/xhgui-branch/issues?utf8=%E2%9C%93&q=is%3Aissue

八. 既然看到这了不如加个微信吧

https://github.com/laynefyc/xhgui-branch/blob/screenshot/screenshot/code-log1.png

http://imgs.it2048.cn/code-log.png

xhgui-branch's People

Stargazers

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

Watchers

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

xhgui-branch's Issues

MongoDB Authentication failed.

版本信息:

  • 操作系统: CentOS 7
  • PHP: PHP7.2.15
  • 扩展 : tideways_xhprof.so
  • MongodDB 版本: MongodDB v4.0.6

问题一:配置文件中增加了mongod的账户密码,一直提示这个: Authentication failed.
去掉mongod的验证就恢复正常,很奇怪
配置如:
'db.options' => array('connect' => true, "username"=>"xhprof","password"=>"xhprof"),
问题二:在虚拟主机中增加了:
fastcgi_param PHP_VALUE "auto_prepend_file=/webdata/ser/xhgui/external/external/header.php";
但是没有任何信息记录,只有require_once('/webdata/ser/xhgui/external/header.php'); 加载才有

具体报错信息:
`Aw shoot, Xhgui hit an error
Authentication failed.

You should check the following things:

Ensure that Mongo has been started
That config/config.php has the right connection information.
That the cache/ directory has the correct permissions.
Stack trace
#0 /webdata/ser/xhgui/vendor/alcaeus/mongo-php-adapter/lib/Mongo/MongoCollection.php(563): Alcaeus\MongoDbAdapter\ExceptionConverter::toLegacy(Object(MongoDB\Driver\Exception\AuthenticationException))
#1 /webdata/ser/xhgui/src/Xhgui/ServiceContainer.php(78): MongoCollection->findOne()
#2 /webdata/ser/xhgui/vendor/pimple/pimple/lib/Pimple.php(126): Xhgui_ServiceContainer->{closure}(Object(Xhgui_ServiceContainer))
#3 /webdata/ser/xhgui/vendor/pimple/pimple/lib/Pimple.php(83): Pimple::{closure}(Object(Xhgui_ServiceContainer))
#4 /webdata/ser/xhgui/src/Xhgui/ServiceContainer.php(88): Pimple->offsetGet('db')
#5 /webdata/ser/xhgui/vendor/pimple/pimple/lib/Pimple.php(83): Xhgui_ServiceContainer->{closure}(Object(Xhgui_ServiceContainer))
#6 /webdata/ser/xhgui/src/Xhgui/ServiceContainer.php(117): Pimple->offsetGet('profiles')
#7 /webdata/ser/xhgui/vendor/pimple/pimple/lib/Pimple.php(83): Xhgui_ServiceContainer->{closure}(Object(Xhgui_ServiceContainer))
#8 /webdata/ser/xhgui/src/routes.php(24): Pimple->offsetGet('runController')
#9 [internal function]: {closure}()
#10 /webdata/ser/xhgui/vendor/slim/slim/Slim/Route.php(468): call_user_func_array(Object(Closure), Array)
#11 /webdata/ser/xhgui/vendor/slim/slim/Slim/Slim.php(1355): Slim\Route->dispatch()
#12 /webdata/ser/xhgui/vendor/slim/slim/Slim/Middleware/Flash.php(85): Slim\Slim->call()
#13 /webdata/ser/xhgui/vendor/slim/slim/Slim/Middleware/MethodOverride.php(92): Slim\Middleware\Flash->call()
#14 /webdata/ser/xhgui/vendor/slim/slim/Slim/Middleware/SessionCookie.php(110): Slim\Middleware\MethodOverride->call()
#15 /webdata/ser/xhgui/src/Xhgui/Middleware/Render.php(11): Slim\Middleware\SessionCookie->call()
#16 /webdata/ser/xhgui/vendor/slim/slim/Slim/Slim.php(1300): Xhgui_Middleware_Render->call()
#17 /webdata/ser/xhgui/webroot/index.php(10): Slim\Slim->run()
#18 {main}
`

中文乱码问题

image

安装后xhgui-branch-master 放置到/var/www/xhgui
扩展
image

MongoDB server version: 3.6.14

不使用作曲家可以安装使用吗?

一定要读
在提交BUG之前请查阅README文件,常见的安装与配置问题都有对应解决办法 。再查看历史ISSUE https://github.com/laynefyc/xhgui-branch/issues?utf8=%E2%9C%93&q=is%3Aissue 是否有答案。都解决不了,请认真填写如下信息

版本信息:

  • 操作系统: [e.g. CentOS 6.8]
  • PHP [e.g. PHP7.1.13]
  • 扩展 [e.g. tideway.so v1.1.14]
  • MongodDB 版本 [e.g. MongodDB v4.0.4]

PHP信息:

  1. 运行php -m 将结果粘贴到当前文本中
  2. 重启php-fpm 问题是否还在?
  3. 直接在浏览器中访问 http://test.com/xhgui-branch/external/header.php (修改为自己的URL)是否报错

具体报错信息:

添加header.php 报500

一定要读
在提交BUG之前请查阅README文件,常见的安装与配置问题都有对应解决办法 。再查看历史ISSUE https://github.com/laynefyc/xhgui-branch/issues?utf8=%E2%9C%93&q=is%3Aissue 是否有答案。都解决不了,请认真填写如下信息

版本信息:
操作系统:
centos7.6
PHP 7.1.29
扩展
tideways-php-5.0.46-1.x86_64
tideways-cli-0.4.0-1.x86_64
tideways-daemon-1.5.70-1.x86_64

  • MongodDB 版本 [e.g. MongodDB v4.0.4]

mongodb-org-server-4.0.9-1.el7.x86_64

PHP信息:

  1. 运行php -m 将结果粘贴到当前文本中
    bcmath
    Core
    ctype
    curl
    date
    dom
    fileinfo
    filter
    ftp
    gd
    gettext
    hash
    iconv
    intl
    json
    libxml
    mbstring
    mcrypt
    mongodb
    mysqli
    mysqlnd
    openssl
    pcntl
    pcre
    PDO
    pdo_mysql
    pdo_sqlite
    Phar
    posix
    Reflection
    session
    shmop
    SimpleXML
    soap
    sockets
    SPL
    sqlite3
    standard
    sysvsem
    tideways
    tokenizer
    xml
    xmlreader
    xmlrpc
    xmlwriter
    xsl
    zip
    zlib

  2. 重启php-fpm 问题是否还在?

  3. 直接在浏览器中访问 http://test.com/xhgui-branch/external/header.php (修改为自己的URL)是否报错

报错500

具体报错信息:
所有项目报500

PHP Fatal error: Uncaught Error: Call to undefined function tideways_enable() in /home/xhgui-branch/external/header.php:102
Stack trace:
#0 {main}
thrown in /home/xhgui-branch/external/header.php on line 102

采集不到任何数据

一定要读
在提交BUG之前请查阅README文件,常见的安装与配置问题都有对应解决办法 。再查看历史ISSUE https://github.com/laynefyc/xhgui-branch/issues?utf8=%E2%9C%93&q=is%3Aissue 是否有答案。都解决不了,请认真填写如下信息

版本信息:

  • 操作系统: [e.g. CentOS 7]
  • PHP [e.g. PHP7.1.18]
  • 扩展 [e.g. tideway.so v5.0.48]
  • MongodDB 版本 [e.g. MongodDB v3.2.22]

PHP信息:

  1. 运行php -m 将结果粘贴到当前文本中
    [PHP Modules]
    bcmath
    Core
    ctype
    curl
    date
    dom
    exif
    filter
    ftp
    gd
    gettext
    hash
    iconv
    intl
    json
    libxml
    mbstring
    mcrypt
    mongodb
    mysqli
    mysqlnd
    openssl
    pcntl
    pcre
    PDO
    pdo_mysql
    pdo_sqlite
    Phar
    posix
    redis
    Reflection
    session
    shmop
    SimpleXML
    soap
    sockets
    SPL
    sqlite3
    standard
    sysvsem
    tideways
    tokenizer
    xml
    xmlreader
    xmlrpc
    xmlwriter
    xsl
    zip
    zlib

  2. 重启php-fpm 问题是否还在?

  3. 直接在浏览器中访问 http://test.com/xhgui-branch/external/header.php (修改为自己的URL)是否报错
    ?不明白这个要求是什么意思。
    这个url怎么可能访问的了,肯定是File not found.啊
    不管是xhgui的http://xhgui.wtx.com/xhgui-branch/external/header.php
    还是我要监控的站http://rrjk.wtx.com/xhgui-branch/external/header.php
    具体报错信息:

我这里是不管网站怎么运行,都没采集到任何信息。
贴上我的nginx配置
server {
listen 80;
server_name rrjk.wtx.com ;
root /vagrant_data/www/jiankang;
fastcgi_param PHP_VALUE "auto_prepend_file=/vagrant_data/www/xhgui-branch/external/header.php";
location / {
index index.html index.htm index.php;
#autoindex on;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
break;
}
}

    location ~ \.php(.*)$ {
        fastcgi_pass   unix:/tmp/php-cgi.sock;
        fastcgi_index  index.php;
        fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        fastcgi_param  PATH_INFO  $fastcgi_path_info;
        fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
        include        fastcgi_params;
    }

}

高版本mongodb 聚合操作 游标选项必填

当mongodb 版本大于3.5 时会报错 “The 'cursor' option is required, except for aggregate with the explain argument” ,原因是高版本的mongodb 拓展 的 \MongoCollection::aggregate 方法需传第二个参数

需在 /xhgui-chinese/src/Xhgui/Profiles.php:173 修改。

php 7下是否不支持?

MongoClient() 不存在,修改为\MongoDB\Driver\Manager(),

Undefined property: MongoDB\Driver\Manager::$xhprof`

页面点击链接一直在加载中

版本信息:

  • 操作系统: CentOS 7.1
  • PHP PHP5.6
  • 扩展 tideway.so v4.16
  • MongodDB 版本v3.4.22

PHP信息:

  1. 运行php -m 将结果粘贴到当前文本中
    [PHP Modules]
    bcmath
    Core
    ctype
    curl
    date
    dom
    ereg
    filter
    ftp
    gd
    gettext
    hash
    iconv
    intl
    json
    libxml
    mbstring
    mcrypt
    mhash
    mongodb
    mysql
    mysqli
    mysqlnd
    openssl
    pcntl
    pcre
    PDO
    pdo_mysql
    pdo_sqlite
    Phar
    posix
    redis
    Reflection
    session
    shmop
    SimpleXML
    soap
    sockets
    SPL
    sqlite3
    standard
    sysvsem
    tideways
    tokenizer
    xml
    xmlreader
    xmlrpc
    xmlwriter
    xsl
    Zend Guard Loader
    zip
    zlib
  2. 重启php-fpm 问题是否还在?
    还在
  3. 直接在浏览器中访问 http://test.com/xhgui-branch/external/header.php (修改为自己的URL)是否报错

具体报错信息:
页面点击链接一直在加载中,项目刚开始用一直都是正常的,差不多半个月后我的mongoDB已经占用5G的数据,现在一点链接,就一直卡在那,不久mongo服务就停止了,其它链接都正常。
image
image

获取不到sql调用详情信息

您好,请问获取sql调用详情时需要配置什么信息吗?我这边所有接口显示的都是没有sql调用,但实际上是有对数据库进行操作的,使用的php版本7.0.13,mysql版本5.6.36

有些图表不显示

版本信息:

  • 操作系统: CentOS 7.1
  • PHP PHP5.6
  • 扩展 tideway.so v4.16
  • MongodDB 版本v3.4.22

PHP信息:

  1. 运行php -m 将结果粘贴到当前文本中
    [PHP Modules]
    bcmath
    Core
    ctype
    curl
    date
    dom
    ereg
    filter
    ftp
    gd
    gettext
    hash
    iconv
    intl
    json
    libxml
    mbstring
    mcrypt
    mhash
    mongodb
    mysql
    mysqli
    mysqlnd
    openssl
    pcntl
    pcre
    PDO
    pdo_mysql
    pdo_sqlite
    Phar
    posix
    redis
    Reflection
    session
    shmop
    SimpleXML
    soap
    sockets
    SPL
    sqlite3
    standard
    sysvsem
    tideways
    tokenizer
    xml
    xmlreader
    xmlrpc
    xmlwriter
    xsl
    Zend Guard Loader
    zip
    zlib
  2. 重启php-fpm 问题是否还在?
    还在
  3. 直接在浏览器中访问 http://test.com/xhgui-branch/external/header.php (修改为自己的URL)是否报错

具体报错信息:
为什么图表没有折线图显示呢?
Image text

PHP7 关于 mongodb 的支持

版本信息:

  • 操作系统: [CentOS 7]
  • PHP [PHP7.0.30]
  • 扩展 [tideway.so ]
  • MongoDB extension version [1.5.3]
  • MongodDB 版本 [v1.4.2]

具体报错信息:
Fatal error: Uncaught Error: Class 'MongoClient' not found in /home/yuli/work/img-server/vendor/laynefyc/xhgui-chinese/src/Xhgui/ServiceContainer.php:77 Stack trace: #0 /home/yuli/work/img-server/vendor/pimple/pimple/lib/Pimple.php(126): Xhgui_ServiceContainer->{closure}(Object(Xhgui_ServiceContainer)) #1 /home/yuli/work/img-server/vendor/pimple/pimple/lib/Pimple.php(83): Pimple::{closure}(Object(Xhgui_ServiceContainer)) #2 /home/yuli/work/img-server/vendor/laynefyc/xhgui-chinese/src/Xhgui/ServiceContainer.php(87): Pimple->offsetGet('db') #3 /home/yuli/work/img-server/vendor/pimple/pimple/lib/Pimple.php(83): Xhgui_ServiceContainer->{closure}(Object(Xhgui_ServiceContainer)) #4 /home/yuli/work/img-server/vendor/laynefyc/xhgui-chinese/src/Xhgui/ServiceContainer.php(124): Pimple->offsetGet('profiles') #5 /home/yuli/work/img-server/vendor/pimple/pimple/lib/Pimple.php(83): Xhgui_ServiceContainer->{closure}(Object(Xhgui_ServiceContainer)) #6 /home/yuli/work/img-server/vendor/laynefyc/xhgui-chinese/src/routes.php(104): Pimple->of in /home/yuli/work/img-server/vendor/laynefyc/xhgui-chinese/src/Xhgui/ServiceContainer.php on line 77

在这个问题提出来之前,我有仔细看了一个相关的 issue ,但我没能从中找到解决问题的答案。
关于mongodb有一些不解:源码中使用的是 $mongo = new MongoClient($config['db.host'], $config['db.options']); 但实际上 php7 使用的 mongodb 扩展已经不支持这种方式了。可为什么看一些楼主,基于 php7 有安装成功了的? 请问这个是不是要等到下一版的更新才能支持 php7?

lineGraph是否有问题

BUG描述
image
首页直接点击URL 跳转到的页面,图表显示不正常

Mac
PHP PHP 7.1.14
xhgui-branch master

$_SERVER['REQUEST_TIME'] 的类型不同会导致排序出现问题

版本信息:

  • 操作系统: Ubuntu 18.04
  • PHP 7.2
  • 扩展 tideways.so 4
  • MongodDB 3.4

具体报错信息:

之前在生产环境观察到一个奇怪的现象。生产环境同一个 PHP 运行了一个 wordpress 实例和我们自己的站点服务,最后发现在 xhgui 中”最近运行“ 展示的只有 wordpress 内的日志,但mongo中确实采集到了自己的站点日志。检测发现是 $_SERVER['REQUEST_TIME'] 在 wp 中会被转为 string 类型,而我们自己站点里面是 int 类型,导致mongo无法正确进行排序。建议在 headers.php 中对这个字段类型强制转化一下。

e.g. headers.php 176行添加 $_SERVER['REQUEST_TIME'] = (string)$time;

下载下来之后安装 ,提示这个问题 ,mongodb扩展 1.5.3 php版本7.1.21 mongo 版本3.4.10 tideways_xhprof 版本 5.0.0

bogon:xhgui-branch fanzheng$ /usr/local/Cellar/[email protected]/7.1.21/bin/php install.php
Downloading composer.
All settings correct for using Composer
Downloading...

Composer (version 1.7.2) successfully installed to: /Users/fanzheng/test1/xhgui2/xhgui-branch/composer.phar
Use it: php composer.phar

Installing dependencies.
ERROR - Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for mongodb/mongodb 1.1.2 -> satisfiable by mongodb/mongodb[1.1.2].
- mongodb/mongodb 1.1.2 requires ext-mongodb ^1.2.0 -> the requested PHP extension mongodb is missing from your system.
Problem 2
- mongodb/mongodb 1.1.2 requires ext-mongodb ^1.2.0 -> the requested PHP extension mongodb is missing from your system.
- alcaeus/mongo-php-adapter 1.0.10 requires mongodb/mongodb ^1.0.1 -> satisfiable by mongodb/mongodb[1.1.2].
- Installation request for alcaeus/mongo-php-adapter 1.0.10 -> satisfiable by alcaeus/mongo-php-adapter[1.0.10].

To enable extensions, verify that they are enabled in your .ini files:
- /etc/php.ini
You can also run php --ini inside terminal to see which files are used by PHP in CLI mode.

Checking permissions for cache directory.
Attempting to set permissions on cache/
Permissions set on cache/

插入mongo抛出了异常:invalid document for insert: keys cannot contain "."

BUG描述
搭建完后可以访问,但一直是初始页面,什么数据都没有,去查错误日志后才发现,在插入mongo的时候抛出了这个异常:
xhgui - invalid document for insert: keys cannot contain ".": "main()==>load::web/index.php"
xhgui - invalid document for insert: keys cannot contain ".": "main()==>load::webroot/index.php"

系统:ubuntu14.04
php版本:5.6.35
mongo:2.6.12
tidesway:4.1.5

请问这个是什么导致的?大佬有遇到过吗?求教!

问题

请问 这个系统 时区在哪里设置?

数据为空

楼主好,我遇到的情况是:xhprof是有数据的,但是xhgui执行时间、CPU时间,内存占用等信息为空,但是请求地址不为空,PHP版本为PHP 7.0.14,xhprof、tideways_xhprof在phpinfo里面都有,请问又遇到过这种情况么???

每条数据点进去报404

404 Page Not Found
The page you are looking for could not be found. Check the address bar to ensure your URL is spelled correctly. If all else fails, you can visit our home page at the link below.

Visit the Home Page

网站添加header.php监控的时候Nginx报502的错误

系统环境:Centos 6.8 LNMP PHP 版本 5.5.38
在Nginx 配置文件里面添加header.php的监控的时候网站访问报502错误。

系统日志报下面的错误。请问主要是什么原因造成的,谢谢!

php-fpm[5209]: segfault at 14 ip 00007ff11b35d468 sp 00007ffec05b9d90 error 4 in tideways.so[7ff11b357000+11000]
php-fpm[14502]: segfault at 14 ip 00007f70ba4c0468 sp 00007fff4c357900 error 4 in tideways.so[7f70ba4ba000+11000]
php-fpm[14504]: segfault at 14 ip 00007f70ba4c0468 sp 00007fff4c357900 error 4 in tideways.so[7f70ba4ba000+11000]
php-fpm[36795]: segfault at 14 ip 00007f78f86f6468 sp 00007ffc31a678b0 error 4 in tideways.so[7f78f86f0000+11000]
php-fpm[36797]: segfault at 14 ip 00007f78f86f6468 sp 00007ffc31a678b0 error 4 in tideways.so[7f78f86f0000+11000]
php-fpm[36799]: segfault at 14 ip 00007f78f86f6468 sp 00007ffc31a678b0 error 4 in tideways.so[7f78f86f0000+11000]

时间显示为UTC时间

展示时时间显示为UTC时间,经测试在webroot的index.php下增加
date_default_timezone_set('PRC');
即可显示为北京时间

sql语句长度超过2000会截断

ubuntu14.04
php5.6.35
tideways4.1.5

你好,请问为什么执行的sql语句存进mongodb的时候最长只有2000个字符?超过2000个字符就直接截断了。有遇到这种情况吗?

Call to undefined function tideways_enable()

版本信息:

  • 操作系统: [e.g. CentOS 7]
  • PHP [e.g. PHP7.2]
  • 扩展 [e.g. tideway.so 7.2]
  • MongodDB 版本 [e.g. MongodDB v4.0.4]

当我把项目里的config。php rand(1, 100) === 42 换成 true 的时候
// Profile 1 in 100 requests.
// You can return true to profile every request.
'profiler.enable' => function() {
return true; //rand(1, 100) === 42;
},
具体报错信息:
[Fatal error: Uncaught Error: Call to undefined function tideways_enable() in /usr/local/nginx/html/xhgui/vendor/perftools/xhgui-collector/external/header.php:99 Stack trace: #0 /usr/local/nginx/html/xhgui/external/header.php(9): require_once() #1 {main} thrown in /usr/local/nginx/html/xhgui/vendor/perftools/xhgui-collector/external/header.php on line 99

SQL需要进行优化

目前如果数据量过大的话,会导致查询变慢,影响使用了。本人对mongo不是很熟悉,不知lz有没有做个优化。

一直无法获取数据

一定要读
在提交BUG之前请查阅README文件,常见的安装与配置问题都有对应解决办法 。再查看历史ISSUE https://github.com/laynefyc/xhgui-branch/issues?utf8=%E2%9C%93&q=is%3Aissue 是否有答案。都解决不了,请认真填写如下信息

版本信息:

  • 操作系统: CentOS_7_03_64
  • PHP PHP 5.6.9
  • 扩展 tideway 5.0.48
  • MongodDB 版本 1.5.2

PHP信息:

  1. 运行php -m 将结果粘贴到当前文本中
    [PHP Modules]
    bcmath
    Core
    ctype
    curl
    date
    dom
    ereg
    filter
    ftp
    gd
    hash
    iconv
    json
    libxml
    mbstring
    mcrypt
    mhash
    mongo
    mongodb
    mssql
    mysql
    mysqli
    mysqlnd
    openssl
    pcre
    PDO
    pdo_mysql
    pdo_sqlite
    Phar
    posix
    redis
    Reflection
    session
    SimpleXML
    sockets
    SPL
    sqlite3
    standard
    tideways
    tokenizer
    xml
    xmlreader
    xmlwriter
    zip
    zlib

  2. 重启php-fpm 问题是否还在?

  3. 直接在浏览器中访问 http://test.com/xhgui-branch/external/header.php (修改为自己的URL)是否报错

具体报错信息:
一直显示下面这个,不知道哪边没配置好

看起来你没有做任何配置

你需要收集一些分析数据才能开始使用XHGUI

无法查看每个接口的详情,点击详情显示:404 Page Not Found

操作系统:ubuntu18.04
php7.2,nginx
mongodb version :3.6.3

接口的cup,执行时间,内存等信息都会被记录,但是点击请求地址下面的接口详情返回
404 Page Not Found
The page you are looking for could not be found. Check the address bar to ensure your URL is spelled correctly. If all else fails, you can visit our home page at the link below.

Visit the Home Page

主页域名:
http://tideways.test01.work/ 可以正常访问
http://tideways.test01.work/url/view?url=%2Furl%2Fview%3Furl%3D%252Fwaterfall 报404错误

ubuntu16.04 php7 同时安装了xhgui扩展和xhgui-branch扩展,xhgui-branch无法写入数据

环境:
ubuntu16.04系统
php7

PHP 7.0.32-0ubuntu0.16.04.1 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.32-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies

mongodb v4.0.4

php插件都已安装

php -m|grep mongo
mongodb
php -m|grep tideways
tideways_xhprof

tideways扩展官网的安装方式连不上:

Err:10 http://s3-eu-west-1.amazonaws.com/tideways/packages debian InRelease
  Could not connect to s3-eu-west-1.amazonaws.com:80 (52.218.96.154), connection timed out
Reading package lists... Done
W: Failed to fetch http://s3-eu-west-1.amazonaws.com/tideways/packages/dists/debian/InRelease  Could not connect to s3-eu-west-1.amazonaws.com:80 (52.218.96.154), connection timed out
W: Some index files failed to download. They have been ignored, or old ones used instead.

tideways扩展使用这种方式安装的:

git clone https://github.com/tideways/php-xhprof-extension.git
cd php-xhprof-extension/
phpize
./configure
make
make install

mongo的日志:

2018-11-21T16:36:13.582+0800 I NETWORK  [conn1160] received client metadata from 127.0.0.1:10224 conn1160: { driver: { name: "mongoc / ext-mongodb:PHP", version: "1.13.0 / 1.5.3" }, os: { type: "Linux", name: "Ubuntu", version: "16.04", architecture: "x86_64" }, platform: "cfg=0x515620c9 posix=200809 stdc=201112 CC=GCC 5.4.0 20160609 CFLAGS="-g -O2" LDFLAGS="" / PHP 7.0.32-0ubuntu0.16.04.1" }
2018-11-21T16:36:21.793+0800 I NETWORK  [listener] connection accepted from 127.0.0.1:10252 #1161 (10 connections now open)

同时安装了xhgui扩展和xhgui-branch扩展,xhgui-branch无法写入数据
ng配置xhgui的时候,可以写入数据,ng再切回xhgui-branch也能正常查看数据,但没有sql的数据
请问这种会是什么原因

Class 'MongoClient' not found

操作系统: centos7.4
PHP版本: 7.5
扩展版本 :
MongoDB extension version | 1.5.3
MongoDb版本:3.6.3

访问提示
Fatal error: Uncaught Error: Class 'MongoClient' not found in /www/wwwroot/xhgui/src/Xhgui/ServiceContainer.php:77

网站添加header.php监控的时候WEB服务报404错误

服务器的环境是LNMP,PHP 的版本是5.5.38。
xhgui-branch安装和界面都正常。
服务器上面运行了xhgui-branch和zabbix,在zabbix配置文件里面添加了PHP页面性测试页面并重启了Nginx服务。
location ~ .php {
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
include fastcgi.conf;
fastcgi_param PHP_VALUE "auto_prepend_file=/data/online/xhgui/external/header.php";
}

PHP性能分析平正常收到监控数据,但我的Zabbix服务页面打开访问的时候报404错误(只有访问/zabbix.php的时候报错,其它PHP页面正常,但这个是入口啊)。

Nginx访问日志:
10.100.82.33 - - [26/Jun/2018:15:31:32 +0800] "GET /zabbix.php?action=dashboard.view HTTP/1.1" 404 162 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Firefox/60.0" "-" "0.099"
PHP错误日志:
2018/06/26 15:31:32 [error] 25063#0: *3598 open() "/data/online/zabbix/error" failed (2: No such file or directory), client: 10.100.82.33, server: 119.51job.com, request: "GET /zabbix.php?action=dashboard.view HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "test.zmzblog.com"

我把zabbix 配置文件里面的下面行注释之后重启nginx服务,访问Zabbix页面的时候正常。
fastcgi_param PHP_VALUE "auto_prepend_file=/data/online/xhgui/external/header.php";

访问日志:
10.100.82.33 - - [26/Jun/2018:15:56:57 +0800] "GET / HTTP/1.1" 302 5 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Firefox/60.0" "-" "0.096"
10.100.82.33 - - [26/Jun/2018:15:56:58 +0800] "GET /zabbix.php?action=dashboard.view HTTP/1.1" 200 4219 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Firefox/60.0" "-" "0.330"

请问大概是什么原因导致的,这样上线的话线上服务是否也会打不开,谢谢!

安装好了有几个问题

1、web界面不支持多站点
2、没有权限控制,连基本的用户名密码校验都没有
3、在哪里可以查看SQL执行时间,如果有就更好了,目前没有找到。

没有图展示了

一直没有折线图, 从 tideways/php-xhprof-extension 换到 tideways 直接在 header.php 中的 tideways_enable() 方法报错了

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.