PHP下解决Cannot find module (IP-MIB)的问题
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PHP下解决Cannot find module (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)
原因
根据错误信息和网上找到的资料,说是没有开启php_snmp.dll这个扩展,但是查看PHP.ini,发现该扩展其实是打开的,进一步深入分析,确认应该是本机没有安装net-SNMP。
解决
到net-SNMP下载一个安装包,注意只有32位的,不过64位机器上也可以用。运行该安装包使用默认路径安装完毕后,确认PHP.ini中开启了php_snmp.dll,重新启动GatewayWorker,问题解决。
以上是关于PHP下解决Cannot find module (IP-MIB)的问题的主要内容,如果未能解决你的问题,请参考以下文章
Error: Cannot find module ‘express‘
Error: Cannot find module ‘express‘
go 报错 cannot find module providing package或cannot find main module
关于cannot find module 'xxxx’的一个可能解决方法。