php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22250 Problem compiling snmp with openssl support
Submitted: 2003-02-17 09:44 UTC Modified: 2003-02-18 13:24 UTC
From: phpbug at spambox dot dk Assigned: sniper (profile)
Status: Not a bug Package: SNMP related
PHP Version: 4CVS-2003-02-18 (stable) OS: FreeBSD 4.7-stable
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: phpbug at spambox dot dk
New email:
PHP Version: OS:

 

 [2003-02-17 09:44 UTC] phpbug at spambox dot dk
I'm trying to add Sablotron/XSLT to my PHP installation with the stable release php4-STABLE-200302171430.

I have installed Expat 1.95.5 and Sablotron 0.97 from source.

I configure PHP with the following options:
./configure --prefix=/usr/local --enable-cli --without-pear --with-mysql=/usr/local/mysql --with-gd --enable-gd-native-ttf --with-t1lib --with-jpeg-dir --with-png-dir --with-tiff-dir --with-zlib-dir --with-freetype-dir=/usr/local/include/freetype2/freetype --with-xpm-dir=/usr/X11R6 --enable-exif --with-iconv --with-openssl=/usr --with-imap --with-imap-ssl=/usr --with-gettext --with-zlib --with-pdflib --enable-exif --enable-ftp --enable-bcmath --with-mcrypt --with-snmp=/usr/local --enable-ucd-snmp-hack --enable-sockets --enable-calendar --with-dom --with-expat-dir=/usr/local --with-xml --enable-xslt --with-xslt-sablot --enable-sablot-errors-descriptive --with-config-file-path=/usr/local/etc --with-tsrm-pth --with-apxs=/usr/local/apache/bin/apxs

But i get the following error:
checking whether to enable xslt support... yes
checking for XSLT Sablotron backend... yes
checking for libexpat dir for Sablotron XSL support... yes
checking for iconv dir for Sablotron XSL support... yes
checking for JavaScript for Sablotron XSL support... yes
checking for Sablotron libraries in the default path... found in /usr/local
checking for sablot-config... found
checking for Sablotron version... configure: error: Sablotron version 0.96 or greater required.

The output from sablot config:
%./sablot-config --version
0.97

What to do?

Best regards Henrik

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-02-17 12:01 UTC] msopacua@php.net
Could you past the last 20 lines or so, from config.log?
 [2003-02-17 12:29 UTC] msopacua@php.net
Also the output of sablot-config --libs please. My guess is you have iconv installed and Sablotron picked up on it. Could you confirm that?
 [2003-02-17 13:36 UTC] phpbug at spambox dot dk
Seems like youre on the right track.

%tail -n 25 config.log 
/tmp/cc4LD9kJ.s:250: Warning: .stabn: description field '12293' too big, try a different debug format
/tmp/cc4LD9kJ.s:255: Warning: .stabn: description field '12294' too big, try a different debug format
/tmp/cc4LD9kJ.s:260: Warning: .stabs: description field '1228c' too big, try a different debug format
/tmp/cc4LD9kJ.s:261: Warning: .stabs: description field '1228d' too big, try a different debug format
/usr/local/lib/libsnmp.so: undefined reference to `des_cbc_encrypt'
/usr/local/lib/libsnmp.so: undefined reference to `des_key_sched'
/usr/local/lib/libsnmp.so: undefined reference to `des_ncbc_encrypt'
configure: failed program was:
#line 74374 "configure"
#include "confdefs.h"

#include <stdlib.h>
#include <sablot.h>

int main ()
{
        double version;
        version = atof(SAB_VERSION);

        if (version >= 0.96) {
                exit(0);
        }
        exit(255);
}


%./sablot-config --libs
-L/usr/local/lib -liconv -lexpat
 [2003-02-17 16:25 UTC] sniper@php.net
This actually is snmp problem, it doesn't have any test
that the selected libs actually work..I'm on it.


 [2003-02-17 17:00 UTC] sniper@php.net
Please try the next stable snapshot from http://snaps.php.net/ in about 2 hours.

 [2003-02-18 02:47 UTC] phpbug at spambox dot dk
Tried with php4-STABLE-200302180830.

Now I get a different error:
checking for SNMP support... yes
checking for default_store.h... yes
checking for OpenSSL support in SNMP libraries... yes
checking for kstat_read in -lkstat... no
checking for snmp_parse_oid... no
checking for init_snmp in -lsnmp... no
configure: error: SNMP sanity check failed. Please check config.log for more information.

-- cut
%tail -n 25 config.log 

; return 0; }
configure:67088: checking for init_snmp in -lsnmp
configure:67107: gcc -o conftest -g -O2  -DMOD_SSL=208112 -DEAPI -DUSE_EXPAT -DSHARED_CORE 
    
    -R/usr/local/lib -L/usr/local/lib -R/usr/X11R6/lib -L/usr/X11R6/lib -R/usr/local/mysql/lib/mysql -L/usr/local/mysql/lib/mysql -R/lib -L/lib conftest.c -lsnmp  -lsnmp -lpdf -lz -ltiff -lpng -ljpeg -lmysqlclient -lmcrypt -lltdl -lcrypt -lpam -lintl -lt1 -lfreetype -lX11 -lXpm -lpng -lz -ljpeg -lz -lz -lssl -lcrypto -lm  -lxml2 -lz -lm -lssl -lcrypto 1>&5
/tmp/ccKXqjQR.s: Assembler messages:
/tmp/ccKXqjQR.s:30: Warning: .stabs: description field '1061e' too big, try a different debug format
/tmp/ccKXqjQR.s:39: Warning: .stabn: description field '1061f' too big, try a different debug format
/tmp/ccKXqjQR.s:42: Warning: .stabn: description field '10620' too big, try a different debug format
/tmp/ccKXqjQR.s:49: Warning: .stabs: description field '1061e' too big, try a different debug format
/usr/local/lib/libsnmp.so: undefined reference to `des_cbc_encrypt'
/usr/local/lib/libsnmp.so: undefined reference to `des_key_sched'
/usr/local/lib/libsnmp.so: undefined reference to `des_ncbc_encrypt'
configure: failed program was:
#line 67096 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char init_snmp();

int main() {
init_snmp()
; return 0; }
-- cut

Im running OpenSSL 0.9.7

Could you move this to a relevant category?

Best regards Henrik
 [2003-02-18 04:26 UTC] msopacua@php.net
Recategorizing.

Sniper's fix works: it points to the correct problem :)
From the looks of this, you have a problem in your libsmnp library. Try recompiling it and could you mention which snmp package this is? Is this the ports version and if so, which exact version (ls -al /var/db/pkg | grep snmp)?
 [2003-02-18 04:33 UTC] phpbug at spambox dot dk
The SNMP package is ucd-snmp-4.2.6.

I compiled this from source with the following:
./configure --prefix=/usr/local --with-persistent-directory=/var/run/ucd-snmp --with-sys-contact="email@example.com" --with-sys-location=Unknown --with-logfile=/var/log/snmpd.log --with-openssl=/usr

I use this for my MRTG, without SSL though.
 [2003-02-18 04:55 UTC] msopacua@php.net
Updated description.

The des* interfaces are from openssl. Is 4.7-stable using openssl 0.9.7 already, or did you compile that yourself?
If it is, I'll cvsup my box and try to replicate your problem - unable to reproduce it, with system supplied openssl 0.9.6g and ucd-snmp-4.2.5_2 port.

It looks like a problem outside of php though (snmp/openssl linking), but I'd like to replicate this first to be sure.
 [2003-02-18 05:58 UTC] phpbug at spambox dot dk
OpenSSL 0.9.7 is in FreeBSD 4.7-stable

From /usr/src/UPDATEING:
20030214: OpenSSL 0.97 has been imported, and the libcrypto/libssl library versions have been bumped.
 [2003-02-18 12:05 UTC] msopacua@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Confirmed that this is not a bug in PHP. With today's  
cvsup'd system, you cannot even compile the ports version  
of ucd-snmp anymore. Version 2.4.6 you can compile, simply  
because it ignores the error, but it doesn't create a 
library. I guess you installed 2.4.6 version before 
upgrading your system? 
  
This issue is with openssl 0.9.7, which changed the des  
interfaces. Compiling the ports version (cvsup'd as well)  
ends with the following error:  
===========================================================  
cc -DINET6 -O -pipe -g -Dfreebsd4 -I. -I.. -I. -I./.. -c  
scapi.c  -fPIC -DPIC -o .libs/scapi.lo  
scapi.c: In function `sc_encrypt':  
scapi.c:612: incompatible type for argument 1 of `memset'  
scapi.c: In function `sc_decrypt':  
scapi.c:725: incompatible type for argument 1 of `memset'  
*** Error code 1  
  
Stop in  
/sql/usr/ports/net/net-snmp4/work/ucd-snmp-4.2.5/snmplib.  
*** Error code 1  
  
Stop in /sql/usr/ports/net/net-snmp4/work/ucd-snmp-4.2.5.  
*** Error code 1  
  
Stop in /usr/ports/net/net-snmp4.  
===========================================================  
  
I'm afraid you'll have to wait until somebody fixes the  
openssl issues in the ports collection :(. 
 [2003-02-18 13:24 UTC] phpbug at spambox dot dk
Just a little side note.

I upgraded to NET-SNMP 5.0.7, and all semed to work.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 06:01:30 2024 UTC