#32680 [Fbk->Opn]: PHP_MSHUTDOWN PHP_MINIT
| From: | dejan at akton dot si | Date: | Mon, 25 Apr 2005 06:27:54 +0000 |
| Subject: | #32680 [Fbk->Opn]: PHP_MSHUTDOWN PHP_MINIT | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-78143@lists.php.net to get a copy of this message | ||
ID: 32680
User updated by: dejan at akton dot si
Reported By: dejan at akton dot si
-Status: Feedback
+Status: Open
Bug Type: SNMP related
Operating System: *
PHP Version: 4CVS, 5CVS (2005-04-15)
Assigned To: sniper
New Comment:
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?
Previous Comments:
------------------------------------------------------------------------
[2005-04-23 23:31:34] sniper@php.net
I can not reproduce this. What apache version are you using?
What configure line did you use with PHP?
------------------------------------------------------------------------
[2005-04-15 14:04:28] sniper@php.net
It was me who added the MSHUTDOWN() to get rid of the
memleaks..fixing.
------------------------------------------------------------------------
[2005-04-12 10:27:57] tony2001@php.net
Assigning to Harrie, he seems to be maintaining ext/snmp.
------------------------------------------------------------------------
[2005-04-12 10:18:46] dejan at akton dot si
Description:
------------
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('127.0.0.1', '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!
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32680&edit=1