php安装skywalking_agent
php的一个项目要做压测,客户要求安装skywalking监测业务。
需要安装对应的php扩展,叫skywalking_agent。实
现本地写入分析日志,并通过aop传到服务端。
网上找了很多方式最后都没成功,自己摸索后记录, 亲测可用。
一.安装依赖
apt update
apt install gcc make llvm-13-dev libclang-13-dev protobuf-c-compiler protobuf-compiler
二.安装Rust
1.一键安装
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain none
2.编译安装
#手动下载安装包
cd /tmp
wget https://download.csdn.net/download/xiantianga6883/92235985?spm=1011.2124.3001.6210
# 解压并安装
tar -xzf rust-1.85.0-x86_64-unknown-linux-gnu.tar.gz
cd rust-1.85.0-x86_64-unknown-linux-gnu
./install.sh
# 验证安装
rustc --version
三. 安装skywalking_agent扩展
1.一键安装
pecl install skywalking_agent

2.编译安装
备用下载地址:https://download.csdn.net/download/xiantianga6883/92235985?spm=1011.2124.3001.6210
准备
#准备工作
# 设置国内镜像源,否则Rust安装会很慢
export RUSTUP_DIST_SERVER=https://mirrors.tuna.tsinghua.edu.cn/rustup
export RUSTUP_UPDATE_ROOT=https://mirrors.tuna.tsinghua.edu.cn/rustup/rustup
git config --global http.postBuffer 524288000
git clone --recursive https://github.com/apache/skywalking-php.git
cd skywalking-php
phpize
./configure
make
make install
四.配置php.ini
[skywalking_agent]
extension = skywalking_agent.so
; Enable skywalking_agent extension or not.
skywalking_agent.enable = On
; Reporter type, optional values are `grpc`, `kafka` and `standalone`.
skywalking_agent.reporter_type = grpc
; Log file path.
skywalking_agent.log_file = /tmp/skywalking-agent.log
; Log level: one of `OFF`,
原文地址:https://blog.csdn.net/xiantianga6883/article/details/154240908
免责声明:本站文章内容转载自网络资源,如侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!
