PHP 5.3.0, 5.3.1 and 5.3.2 do not have SNMP support. SNMP support has restored in PHP 5.3.3.
The Windows distribution of Net-SNMP contains support files for SNMP in the
mibs directory. This directory
should be moved to DRIVE:\usr\mibs,
where DRIVE must be replaced with the driveletter where PHP is installed on,
e.g.c:\usr\mibs. Alternatively you
may set MIBDIRS environment variable pointed to your MIBs folder.
Important notes for PHP prior to 5.4.0: In order to use the UCD SNMP package, you need to define
NO_ZEROLENGTH_COMMUNITY to 1 before
compiling it. After configuring UCD SNMP, edit config.h
or acconfig.h and search for
NO_ZEROLENGTH_COMMUNITY. Uncomment the #define line. It
should look like this afterwards:
#define NO_ZEROLENGTH_COMMUNITY 1
Now compile PHP --with-snmp[=DIR]
If you see strange segmentation faults in combination with SNMP commands,
you did not follow the above instructions. If you do not want to recompile
UCD SNMP, you can compile PHP with the
will work around the misfeature.
1 year ago
In order to build and install php in Ubuntu 12.10, beyond the normal "build-essential" package, I had to install the following packages: apache2-prefork-dev libxml2-dev libsnmp libsnmp-dev libtool
Command line should be like this:
sudo apt-get install apache2-prefork-dev libxml2-dev libsnmp libsnmp-dev libtool
flintjt att hotmail dot com ¶
2 years ago
For win32 (tested on win XP and 2k3 server 32bit):
Tested with versions 5.3.3 VC9, and 5.3.6 VC9.
The php_snmp.dll, requires that you set the environment variable MIBDIRS pointed to your MIBs folder.
Darren Wolfe ¶
1 year ago
If PHP complains that some mibs are missing and they are not included in your windows php package, they can be obtained from the source package of net-snmp itself.