我已启用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)
Run Code Online (Sandbox Code Playgroud)
我知道我已经修好了一次,但我似乎无法再修复它......我还能尝试什么?
我在Windows上.
mar*_*cus 10
我在使用php7.1的Ubuntu中遇到了同样的问题,解决方法是安装snmp包
apt-get install snmp
Run Code Online (Sandbox Code Playgroud)
php包不包含mibs文件夹,你需要做的是下载net-snmp的源文件并将文件夹复制到你的php目录中
下载链接 https://sourceforge.net/projects/net-snmp/files/net-snmp/5.7.3/
之后,解压 zip 文件并将 mibs 文件夹复制到您的 php 目录
例如,将其复制到 C:\PHP\Extras\mibs
然后添加一个名为 MIBDIRS 的新系统变量。它的值应该是:C:\PHP\Extras\mibs
最后,你可以运行 php -m
您的问题将得到解决
打开您的php.ini并在行中添加一些神奇的分号,如下所示:
extension=php_snmp.dll
Run Code Online (Sandbox Code Playgroud)
它应该看起来像:
;extension=php_snmp.dll
Run Code Online (Sandbox Code Playgroud)
小智 5
在Linux上,我可以通过将其添加到我的/etc/php5/apache2/conf.d/snmp.ini文件中来解决这些问题。
mibdir = / usr / share / snmp / mibs
mibs =全部
| 归档时间: |
|
| 查看次数: |
22093 次 |
| 最近记录: |