当前位置:  开发笔记 > 编程语言 > 正文

PHP SNMP - 无法找到模块

如何解决《PHPSNMP-无法找到模块》经验,为你挑选了4个好方法。

我已启用SNMP模块尝试模块中的功能.我已将MIBDIRS环境变量设置为我拥有mibs的位置,但我仍然收到这些"无法找到模块"警告:

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 (DISMAN-EVENT-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 (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)

我知道我已经修好了一次,但我似乎无法再修复它......我还能尝试什么?

我在Windows上.



1> 小智..:

我在使用php7.1的Ubuntu中遇到了同样的问题,解决方法是安装snmp包

apt-get install snmp



2> PLui..:

显然,您可以设置2个环境变量.一个是MIBDIRS所有MIB文件所在的位置.另一个是MIBS,我相信你要加载哪些SNMP模块.通过设置MIBSALL,我能摆脱错误的.



3> Wesley Schle..:

打开您的php.ini并在行中添加一些神奇的分号,如下所示:

extension=php_snmp.dll

它应该看起来像:

;extension=php_snmp.dll



4> 小智..:

在Linux上,我可以通过将其添加到我的/etc/php5/apache2/conf.d/snmp.ini文件中来解决这些问题。

mibdir = / usr / share / snmp / mibs
mibs =全部

推荐阅读
无名有名我无名_593
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有