PHP下解决Cannotfindmodule(IP-MIB)的问题

现象

最近工作中给公司的系统中增加了一些网络有关的功能,它是基于GatewayWorker的,启动后报告类似如下的错误信息:
Cannot find module (IP-MIB): At line 0 in (none)
Cannot find module (IF-MIB): At line 0 in (none)
Cannot find module (TCP-MIB): At line 0 in (none)
Cannot find module (UDP-MIB): At line 0 in (none)
Cannot find module (HOST-RESOURCES-MIB): At line 0 in (none)
Cannot find module (SNMPv2-MIB): At line 0 in (none)
Cannot find module (SNMPv2-SMI): At line 0 in (none)
Cannot find module (NOTIFICATION-LOG-MIB): At line 0 in (none)
Cannot find module (UCD-SNMP-MIB): At line 0 in (none)
Cannot find module (UCD-DEMO-MIB): At line 0 in (none)
Cannot find module (SNMP-TARGET-MIB): At line 0 in (none)
Cannot find module (NET-SNMP-AGENT-MIB): At line 0 in (none)
Cannot find module (SNMP-VIEW-BASED-ACM-MIB): At line 0 in (none)
Cannot find module (SNMP-COMMUNITY-MIB): At line 0 in (none)
Cannot find module (NET-SNMP-EXTEND-MIB): At line 0 in (none)
Cannot find module (UCD-DLMOD-MIB): At line 0 in (none)
Cannot find module (SNMP-FRAMEWORK-MIB): At line 0 in (none)
Cannot find module (SNMP-MPD-MIB): At line 0 in (none)
Cannot find module (SNMP-USER-BASED-SM-MIB): At line 0 in (none)
Cannot find module (SNMP-NOTIFICATION-MIB): At line 0 in (none)
Cannot find module (SNMPv2-TM): At line 0 in (none)

创新互联是一家专注于成都网站设计、网站制作与策划设计,英吉沙网站建设哪家好?创新互联做网站,专注于网站建设10多年,网设计领域的专业建站公司;建站业务涵盖:英吉沙等地区。英吉沙做网站价格咨询:028-86922220

原因

根据错误信息和网上找到的资料,说是没有开启php_snmp.dll这个扩展,但是查看PHP.ini,发现该扩展其实是打开的,进一步深入分析,确认应该是本机没有安装net-SNMP。

解决

到net-SNMP下载一个安装包,注意只有32位的,不过64位机器上也可以用。运行该安装包使用默认路径安装完毕后,确认PHP.ini中开启了php_snmp.dll,重新启动GatewayWorker,问题解决。


网站题目:PHP下解决Cannotfindmodule(IP-MIB)的问题
网站网址:http://pwwzsj.com/article/jgssii.html