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

Forum for you who has PHP installation issues

Moderators: macek, egami, gesf

HelloWorld
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

Hello,

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 5.5.6-1+debphp.org~precise+2
SNMP Rasmus Lerdorf, Harrie Hazewinkel, Mike Jackson, Steven Lawrance, Johann Hanne, Boris Lytochkin

a simple php code:
root@ubuntu:/var/www# cat status.php
<?php
$session = new SNMP(SNMP::VERSION_1, "127.0.0.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 144.254.183.8:18714] 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
root@ubuntu:/var/www#

How can I fix this ?

Thx,
A.

Return to “PHP Installation”

Who is online

Users browsing this forum: No registered users and 1 guest

cron