Centos7下给安装php snmp扩展

1.基础环境准备

yum install net-snmp php-snmp net-snmp-devel

2.进入PHP源码包
3.进入ext文件夹下的snmp文件夹
4.设置配置文件

phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-snmp

5.编译

make && make install

6.将模块增加进配置文件


vi + /usr/local/php/etc/php.ini

# 文件末尾增加

extension = snmp.so

7.重启服务

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注