|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Submitted: 2005-04-12 10:18 UTC Modified: 2005-05-10 15:30 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: dejan at akton dot si Assigned: sniper (profile)
Status: Closed Package: SNMP related
PHP Version: 4CVS, 5CVS (2005-04-15) OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
39 + 43 = ?
Subscribe to this entry?

 [2005-04-12 10:18 UTC] dejan at akton dot si
In 4.3.11 someone added a PHP_MSHUTDOWN(snmp) to ext/snmp/snmp.c extension. I'm not so familiar with the PHP source it self, but here's what I see.
In CLI version, PHP_MINIT() and PHP_MSHUTDOWN works as expected, when script starts PHP_MINIT() is called which initialized the snmp API and when script is done, PHP_MSHUTDOWN is called, which clears the instance of snmp API. But under Apache there's a problem.
When apache starts, it calls PHP_MINIT() but it also calls PHP_MSHUTDOWN, which clears the instance. When you request a script via Apache, the PHP_MINIT() is not called and SNMP Api is not initialized and I receive strange errors. 

Reproduce code:
$foo = snmpget('', 'public', 'system.SysContact.0');

Expected result:
Output from system.SysContect.0

Actual result:
Invalid OID and invalid host. From the SNMP API I receive: 
No support for requested transport domain "udp".
And this is because the API was not initialized and transport domains were not loaded!


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-04-15 14:04 UTC]
It was me who added the MSHUTDOWN() to get rid of the memleaks..fixing.

 [2005-04-23 23:31 UTC]
I can not reproduce this. What apache version are you using?
What configure line did you use with PHP? 

 [2005-04-25 08:27 UTC] dejan at akton dot si
My configure line:
'./configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-zlib' '--enable-bcmath' '--enable-calendar' '--with-dom' '--with-dom-xslt' '--with-dom-exslt' '--enable-exif' '--enable-ftp' '--with-gd' '--with-t1lib' '--with-gettext' '--with-imap=/usr/include/imap' '--with-mysql=/usr/local' '--with-ncurses' '--enable-pcntl' '--with-readline' '--with-snmp=/usr/local' '--enable-sockets' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--enable-msdblib' '--enable-dbmfix' '--with-tdsver=7.0' '--with-freetds=/usr/local' '--with-mssql' '--with-openssl' '--with-ttf' '--with-freetype-dir=/usr/local' '--disable-ipv6' '--disable-debug' '--enable-dio' 

Apache Version: Apache/1.3.29 

I tried with two net-snmp versions, including the new one 5.2.1

PHP_MINIT should be called with every request to a PHP script via Apache? And PHP_MSHUTDOWN when script ends?
 [2005-04-25 23:57 UTC]
Try this configure line:

# ./configure --disable-all --with-apxs=/usr/local/apache/bin/apxs --with-snmp=/usr/local

Using this snapshot:

 [2005-04-26 14:17 UTC] dejan at akton dot si
Same thing happened. Any clues as to what is causing this problem? Is this a specific problem only on my computer?
 [2005-04-29 01:10 UTC]
I need to test this with Apache1 sometime, but atm I have no time. (I use Apache2 myself)

If you can, do try with Apache2 to see if the problem disappears.

 [2005-05-10 15:30 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 22 22:01:28 2024 UTC