downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

Configuration à l'exécution> <Pré-requis
[edit] Last updated: Fri, 24 May 2013

view this page in

Installation

PHP 5.3.0, 5.3.1 et 5.3.2 n'ont pas de support SNMP. Le support SNMP a été restauré en PHP 5.3.3.

La distribution Windows de Net-SNMP contient les fichiers SNMP dans le dossier mibs. Ce dossier doit être déplacé vers DRIVE:\usr\mibs, où DRIVE doit être remplacé par la lettre du lecteur où PHP est installé, i.e. c:\usr\mibs. Alternativement, vous pouvez définir la variable d'environnement MIBDIRS pour pointer vers le dossier MIBs.

Note important pour les versions de PHP antérieures à 5.4.0 : afin d'utiliser le paquet UCD SNMP, vous devez mettre la variable NO_ZEROLENGTH_COMMUNITY à 1 avant de compiler. Après avoir configuré UCD SNMP, éditez le fichier config.h ou le fichier acconfig.h et recherchez la valeur NO_ZEROLENGTH_COMMUNITY. Décommentez la ligne contenant le #define. Cela doit ressembler à ceci :

#define NO_ZEROLENGTH_COMMUNITY 1
Ensuite, compilez PHP avec l'option --with-snmp[=DIR] .

Si vous rencontrez des erreurs étranges de "segmentation fault", lors de l'utilisation des commandes SNMP, c'est que vous n'avez pas suivi les recommandations précédentes. Si vous ne voulez pas recompiler UCD SNMP, vous pouvez aussi recompiler PHP avec l'option --enable-ucd-snmp-hack qui évitera cette erreur.



Configuration à l'exécution> <Pré-requis
[edit] Last updated: Fri, 24 May 2013
 
add a note add a note User Contributed Notes Installation - [3 notes]
up
-1
Darren Wolfe
11 months 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.
up
-1
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.
up
0
Coffee-fan
3 months 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

 
show source | credits | sitemap | contact | advertising | mirror sites