PHP无法在Windows 7下找到SNMP模块 [英] PHP cant find SNMP modules under Windows 7

查看:242
本文介绍了PHP无法在Windows 7下找到SNMP模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已启用SNMP模块,尝试使用该模块中的功能.我已将MIBDIRS环境变量设置为我的mib所在的位置,但仍收到以下找不到模块"警告:

I've enabled the SNMP module was trying to the functions in the module. I have set the MIBDIRS environment variable to where I have my mibs but I'm still getting these "Cannot find module" warnings:

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)

我的php.ini设置为:

My php.ini settings are:

mibdir=C:\\Users\username\Downloads\Applications\Dev\PHP\5.4\net-snmp-mibs\net-snmp-5.7.2.1\mibs
mibs=all
extension=php_snmp.dll

我在Windows上.

I'm on Windows.

它仍然会给出那些错误...

And it still gives those errors...

请问有何见解?

推荐答案

PHP文档在Windows上具有误导性; 为了消除错误并使SNMP模块正常工作,您必须在系统中添加一个名为 MIBDIRS 的环境变量,并指向您的mib文件的位置

The PHP docs is misleading for Windows; In order to get rid of the errors and have SNMP module working properly, you MUST add an environment variable in the System, called MIBDIRS and pointing to the location of your mib files.

例如,在Windows 7上,是系统属性>环境变量>用户变量"部分,单击新建"并添加MIBDIRS,其值为C:\ usr \ mibs(或放置mibs文件夹的任何位置).

On Windows 7 for example, that would be System Properties > Environment Variables > User variables section, click New and add MIBDIRS, with value of C:\usr\mibs (or wherever you put the mibs folder).

应使用Net-SNMP软件包提取文件,并使用CLI模式在PHP 5.4.7上使用net-snmp-5.7.2.1版本进行测试.

The files should be extracted using a Net-SNMP package, tested with version net-snmp-5.7.2.1 on PHP 5.4.7 using CLI mode.

这篇关于PHP无法在Windows 7下找到SNMP模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆