php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47659 SNMP Builds with Obsolete UCD-SNMP
Submitted: 2009-03-14 20:49 UTC Modified: 2011-08-23 19:19 UTC
Votes:7
Avg. Score:4.3 ± 0.9
Reproduced:7 of 7 (100.0%)
Same Version:4 (57.1%)
Same OS:6 (85.7%)
From: larryjadams at comcast dot net Assigned: lytboris (profile)
Status: Closed Package: SNMP related
PHP Version: 5.2.9 OS: win32 only
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: larryjadams at comcast dot net
New email:
PHP Version: OS:

 

 [2009-03-14 20:49 UTC] larryjadams at comcast dot net
Description:
------------
The SNMP Extension builds with UCD-SNMP which has been obsolete for some time.  I will attach a patch that will correct this behavior.  Please note that the build source will require a recent version of netsnmp.lib to build properly.

Reproduce code:
---------------
Not required.  Will provide patch.  However, if you run phpinfo(), it reports UCD-SNMP.

Expected result:
----------------
NET-SNMP

Actual result:
--------------
UCD-SNMP

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-14 20:54 UTC] larryjadams at comcast dot net
--- snmp.dsp	2004-01-17 06:59:48.000000000 -0500
+++ patches/snmp.dsp	2009-03-14 16:37:56.267879800 -0400
@@ -54,7 +54,7 @@
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib libsnmp.lib wsock32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_snmp.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib libsnmp.lib netsnmp.lib wsock32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_snmp.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
 
 !ELSEIF  "$(CFG)" == "snmp - Win32 Debug_TS"
 
@@ -81,7 +81,7 @@
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib libsnmp.lib wsock32.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_snmp.dll" /libpath:"..\..\Debug_TS"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib libsnmp.lib netsnmp.lib wsock32.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_snmp.dll" /libpath:"..\..\Debug_TS"
 
 !ENDIF 
 
--- config.w32	2003-12-19 11:00:10.000000000 -0500
+++ patches/config.w32	2009-03-14 16:38:00.731879800 -0400
@@ -4,13 +4,17 @@
 ARG_WITH("snmp", "SNMP support", "no");
 
 if (PHP_SNMP != "no") {
-
-	if (CHECK_HEADER_ADD_INCLUDE("snmp.h", "CFLAGS_SNMP", PHP_PHP_BUILD + "\\include\\ucd-snmp;" + PHP_PHP_BUILD + "\\include\\net-snmp;" + PHP_SNMP) &&
-			CHECK_LIB("libsnmp.lib", "snmp", PHP_SNMP)) {
+	if (CHECK_HEADER_ADD_INCLUDE("snmp.h", "CFLAGS_SNMP", PHP_PHP_BUILD + "\\include\\ucd-snmp;" + PHP_PHP_BUILD + "\\include\\net-snmp;" + PHP_SNMP)) {
+		if (CHECK_LIB("netsnmp.lib", "snmp", PHP_SNMP)) {
 		EXTENSION('snmp', 'snmp.c');
-
 		AC_DEFINE('HAVE_SNMP', 1);
-
+			AC_DEFINE("HAVE_NET_SNMP", 1);
+		} else if (CHECK_LIB("libsnmp.lib", "snmp", PHP_SNMP)) {
+			EXTENSION('snmp', 'snmp.c');
+			AC_DEFINE('HAVE_SNMP', 1);
+		} else {
+			WARNING("snmp not enabled; libraries and headers not found");
+		}
 	} else {
 		WARNING("snmp not enabled; libraries and headers not found");
 	}
 [2011-08-20 16:28 UTC] lytboris@php.net
-Status: Open +Status: Feedback
 [2011-08-20 16:28 UTC] lytboris@php.net
Is this still a pressing problem?
 [2011-08-23 12:15 UTC] larryjadams at comcast dot net
-Status: Feedback +Status: Open
 [2011-08-23 12:15 UTC] larryjadams at comcast dot net
Boris,

This issue has been fixed in 5.3.  So, I think we can close it.  Philippe had committed my changes SVN.  Do the check just to make sure.

Regards,

Larry Adams
 [2011-08-23 19:19 UTC] lytboris@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: lytboris
 [2011-08-23 19:19 UTC] lytboris@php.net
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at 
http://www.php.net/downloads.php


 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Nov 17 03:01:36 2019 UTC