php写point,pinpoint支持php

环境:

centos7

pinpoint1.7.3(服务端)

php7.1

gcc4.8.5

1、安装依赖包

yum install automake libtool flex bison pkgconfig gcc-c++

3、执行编译脚本

cd ./pinpoint-c-agent/pinpoint_php

./Build.sh

等待编译结果

...failed updating 56 targets...

...skipped 6 targets...

...updated 14483 targets...

出现如上结果编译结束

4、设置环境变量

export LD_LIBRARY_PATH=$PWD/../thirdlibray/var/:$LD_LIBRARY_PATH

5、phpize

6、再执行编译脚本

./Build.sh

报错:fatal error: openssl/opensslv.h: No such file or directory

解决:yum install openssl-devel

报错:configure: error: Cannot find php-config. Please use --with-php-config=PATH

解决:在Build.sh脚本的build_agent函数里./configure后边加上--w

ith-php-config=/opt/remi/php71/root/usr/bin/php-config(php-config文件所在路径)

重新编译

Build complete.

Don't forget to run 'make test'.

直到看到如上结果编译完成

7、make install

执行结果Installing shared extensions:会显示pinpoint.so的安装路径

8、配置文件

/etc/pinpoint_agent.conf可参考./pinpoint-c-agent/quickstart/config/pinpoint_agent.conf.example

其中:AgentID、ApplicationName、Collector、LogFileRootPath根据自己情况写

PluginRootDir为php代码目录下边的pinpoint_plugins目录所在路径(需把./pinpoint-c-agent/quickstart/php/web/plugins目录下的文件拷贝到php代码所在目录的pinpoint_plugins目录下)

6d2def81da899c01728f7fbc8a2e489e.png

cat php71_PATH/php.d/pinpoint.ini

[pinpoint]

extension=/opt/remi/php71/root/usr/lib64/php/modules/pinpoint.so

pinpoint_agent.config_full_name=/etc/pinpoint_agent.conf

此配置文件指定模块文件所在路径和agent配置文件所在路径

php -m |grep pinpoint

查看是否报错

报错:open /workspace/logs/webapps/pinpoint_log.txt failed : No such file or directory

解决:创建日志目录即可

报错:PHP Parse error: syntax error, unexpected ';', expecting ',' or ')' in /workspace/webapps/pinpoint_plugins/curl_plugin.php

解决:拷贝https://github.com/naver/pinpoint-c-agent.git 代码里最新tag的quickstart/php/web/plugins/curl_plugin.php文件替换/workspace/webapps/pinpoint_plugins/curl_plugin.php

9、简单测试

用ab工具请求了2w次web服务

ab -c 10 -n 20000 http://172.16.65.85/index.php

14ea93688bbc1dd6def8a815d9cede02.png

可看到监控Application list里出现了刚才添加的testphp71-demo并且收到了刚才模拟请求的数据

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值