note 43253 added to ref.snmp
| From: | peterdatnospamtelephoneticscouk at rn2 dot php dot net | Date: | Tue, 15 Jun 2004 16:37:45 +0000 |
| Subject: | note 43253 added to ref.snmp | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-71110@lists.php.net to get a copy of this message | ||
I've found that when using SNMP on Windows (2000 Pro) the drive the mib files have to be
located on actually depends on where you subsequently call PHP from.
For example:
(Assume PHP is installed in c:\\php and the mibs are installed in c:\\usr\\mibs and you have a
script c:\\test.php)
Open a command prompt at c:\\
Calling c:\\php\\cli\\php.exe c:\\test.php will work fine.
Change directory to d:\\
Execute c:\\php\\cli\\php.exe c:\\test.php will now cause an error about not finding mib files.
If you now copy the mibs to d:\\usr\\mibs and run the above command again, it will now work fine.
Effectively the drive the mibs has to be on is the same as the drive of the current working
directory when you call PHP.
This isn't very useful at all, so after some digging around there seems to be an environment
variable (MIBDIRS) you can set specifying where the MIBs are to be found.
After setting MIBDIRS=c:\\php\\mibs in the environment and placing the mibs there, everything seemed
to work fine.
Note: If you need SNMP whilst using apache you may have to use the PassEnv command with MIBDIRS in
your apache config, I haven't tried this yet.
----
Manual Page -- http://www.php.net/manual/en/ref.snmp.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+43253
Delete -- http://master.php.net/manage/user-notes.php?action=delete+43253&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+43253&report=yes
Search -- http://master.php.net/manage/user-notes.php