php + snmp = Class 'SNMP' not found ...

Forum for you who has PHP installation issues

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 1
Joined: Tue Nov 26, 2013 6:36 am

php + snmp = Class 'SNMP' not found ...

Postby HelloWorld » Tue Nov 26, 2013 6:43 am


I'm trying to add snmp support to php on my ubuntu system.
Ubuntu is running "12.04 LTS Precise Pangolin".
and SNMP is listed in phpinfo(); along with version installed:

PHP Version
SNMP Rasmus Lerdorf, Harrie Hazewinkel, Mike Jackson, Steven Lawrance, Johann Hanne, Boris Lytochkin

a simple php code:
root@ubuntu:/var/www# cat status.php
$session = new SNMP(SNMP::VERSION_1, "", "public");
$sysdescr = $session->get("sysDescr.0");
echo "$sysdescr\n";

generate this error:
[Tue Nov 26 15:31:36.209386 2013] [:error] [pid 28357] [client] PHP Fatal error: Class 'SNMP' not found in /var/www/status.php on line 9

If I try to list the supported module I do not see snmp listed:

root@ubuntu:/var/www# php -m | grep -i snmp

How can I fix this ?


Return to “PHP Installation”

Who is online

Users browsing this forum: No registered users and 2 guests