#45883 [Fbk->Opn]: Snmp functions fail via CLI
| From: | richrumble at gmail dot com | Date: | Thu, 21 Aug 2008 17:28:21 +0000 |
| Subject: | #45883 [Fbk->Opn]: Snmp functions fail via CLI | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-128290@lists.php.net to get a copy of this message | ||
ID: 45883
User updated by: richrumble at gmail dot com
Reported By: richrumble at gmail dot com
-Status: Feedback
+Status: Open
Bug Type: SNMP related
Operating System: Windows
PHP Version: 5.2.6
New Comment:
I've tried specifying the php.ini via the -c argument
C:\php>php.exe -c c:\php\php.ini snmptest.php
I've copied the php.ini file to c:\windows\
SNMP is enabled when I call phpinfo via the browser, but does not show
enabled when called via CLI. It's easy to reproduce on any windows
system. There appear to be no additional steps to install php-snmp
extension, uncomment in php.ini, and snmpwalk works via browser, but
fails via cli.
-rich
Previous Comments:
------------------------------------------------------------------------
[2008-08-21 16:30:57] pajoye@php.net
which php.ini is used by your webserver and which is used by cli?
Do you get any error while running cli (cannot find dll xyz, etc)?
Have you installed the required files and data as described in the
manual?
------------------------------------------------------------------------
[2008-08-21 16:22:23] richrumble at gmail dot com
Description:
------------
Technically phpinfo() can show you part of the problem
With SNMP enabled, running that script from the browser will show you
snmp enabled, running the phpinfo script from cli shows it's not
enabled, but every other function is!
Any simple snmp command will result in the following error:
Fatal error: Call to undefined function snmprealwalk()
substitute snmprealwalk with any snmp function
Reproduce code:
---------------
<?php
phpinfo();
?>
or
<?php
$host = "localhost";
$community = "public";
$oid = ".1.3.6.1.2.1.2.2.1.2";
$arr = snmpwalk($host, $community, $oid);
print_r($arr);
?>
Expected result:
----------------
PhpInfo(cli) that matches phpinfo from browser
SNMP results from host.
Actual result:
--------------
SNMP Extension missing from phpinfo when called via command line
interface
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=45883&edit=1