ramakuka Posted September 19, 2007 Share Posted September 19, 2007 Hi , I am trying to compile php on solaris 10 to use it as a cacti server . I just installed mysql 5 and I have apache already installed , but for some reason I can’t compile the php with snmp. My configure syntax is : ./configure --with-apxs2=/usr/local/apache2/bin/apxs --enable-dbase --with-libxml-dir=/usr/local --with-config-file-path=/etc/apache2/ --with-mysql=shared,/opt/mysql/mysql/ --with-mysqli=shared,/opt/mysql/mysql/bin/mysql_config --with-xpm-dir=/usr --with-gd --with-bz2=/usr/lib --with-jpeg-dir=/usr --with-png-dir=/usr --with-zlib --enable-mbstring --enable-calendar --enable-bcmath --enable-ftp --enable-exif --with-snmp=/tmp/php/net-snmp-5.4.1/snmplib/ The net-snmp-5.4.1/ is the package I downloaded from net-snmp project. I also tried to use the native snmp library that come with the Solaris system , the same error accord This is the error that I get : checking for xml2-config path... (cached) /usr/local/bin/xml2-config checking whether libxml build works... (cached) yes checking for SNMP support... yes checking OpenSSL dir for SNMP... no checking whether to enable UCD SNMP hack... no checking for default_store.h... no checking for kstat_read in -lkstat... yes checking for snmp_parse_oid in -lsnmp... no checking for init_snmp in -lsnmp... no configure: error: SNMP sanity check failed. Please check config.log for more information. And this is the config.log relevant lines: configure:85768: checking whether to enable shmop support configure:86104: checking whether to enable SimpleXML support configure:86183: checking for xml2-config path configure:86341: checking whether libxml build works configure:86745: checking for SNMP support configure:86792: checking OpenSSL dir for SNMP configure:86818: checking whether to enable UCD SNMP hack configure:87047: checking for default_store.h configure:87057: gcc -E -I/tmp/php/net-snmp-5.4.1/snmplib//include conftest.c >/dev/null 2>conftest.out configure:87053:27: default_store.h: No such file or directory configure: failed program was: #line 87052 "configure" #include "confdefs.h" #include <default_store.h> configure:87812: checking for kstat_read in -lkstat configure:87831: gcc -o conftest -I/usr/local/include -g -O2 -D_POSIX_PTHREAD_SEMANTICS -liconv -L/usr/local/lib -R/usr/ucblib -L/usr/ucblib -R/usr/local/lib/gcc-lib/sparc-sun-solaris2.10/3.3.2 -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.10/3.3.2 -R/usr/local/lib -L/usr/local/lib conftest.c -lkstat -lrt -liconv -lX11 -lXpm -lpng -lz -ljpeg -lbz2 -lz -lresolv -lm -lnsl -lsocket -lgcc -lxml2 -lz -liconv -lm -lsocket -lnsl -lxml2 -lz -liconv -lm -lsocket -lnsl -lxml2 -lz -liconv -lm -lsocket -lnsl 1>&5 configure:88102: checking for snmp_parse_oid in -lsnmp configure:88121: gcc -o conftest -I/usr/local/include -g -O2 -D_POSIX_PTHREAD_SEMANTICS -liconv -L/usr/local/lib -R/usr/ucblib -L/usr/ucblib -R/usr/local/lib/gcc-lib/sparc-sun-solaris2.10/3.3.2 -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.10/3.3.2 -R/usr/local/lib -L/usr/local/lib -R/tmp/php/net-snmp-5.4.1/snmplib//lib -L/tmp/php/net-snmp-5.4.1/snmplib//lib conftest.c -lsnmp -lsnmp -lkstat -lrt -liconv -lX11 -lXpm -lpng -lz -ljpeg -lbz2 -lz -lresolv -lm -lnsl -lsocket -lgcc -lxml2 -lz -liconv -lm -lsocket -lnsl -lxml2 -lz -liconv -lm -lsocket -lnsl -lxml2 -lz -liconv -lm -lsocket -lnsl 1>&5 ld: fatal: library -lsnmp: not found ld: fatal: library -lsnmp: not found ld: fatal: File processing errors. No output written to conftest collect2: ld returned 1 exit status configure: failed program was: #line 88110 "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 snmp_parse_oid(); int main() { snmp_parse_oid() ; return 0; } configure:88255: checking for init_snmp in -lsnmp configure:88274: gcc -o conftest -I/usr/local/include -g -O2 -D_POSIX_PTHREAD_SEMANTICS -liconv -L/usr/local/lib -R/usr/ucblib -L/usr/ucblib -R/usr/local/lib/gcc-lib/sparc-sun-solaris2.10/3.3.2 -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.10/3.3.2 -R/usr/local/lib -L/usr/local/lib -R/tmp/php/net-snmp-5.4.1/snmplib//lib -L/tmp/php/net-snmp-5.4.1/snmplib//lib conftest.c -lsnmp -lsnmp -lkstat -lrt -liconv -lX11 -lXpm -lpng -lz -ljpeg -lbz2 -lz -lresolv -lm -lnsl -lsocket -lgcc -lxml2 -lz -liconv -lm -lsocket -lnsl -lxml2 -lz -liconv -lm -lsocket -lnsl -lxml2 -lz -liconv -lm -lsocket -lnsl 1>&5 ld: fatal: library -lsnmp: not found ld: fatal: library -lsnmp: not found ld: fatal: File processing errors. No output written to conftest collect2: ld returned 1 exit status configure: failed program was: #line 88263 "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; } How can I resolve that ? any idea? thanks Quote Link to comment https://forums.phpfreaks.com/topic/69885-problem-compling-php-with-snmp-php-524/ Share on other sites More sharing options...
trq Posted September 19, 2007 Share Posted September 19, 2007 Did you follow the instructions here? In particular the.... Important: In order to use the UCD SNMP package, you need to define NO_ZEROLENGTH_COMMUNITY to 1 before compiling it. After configuring UCD SNMP, edit config.h or acconfig.h and search for NO_ZEROLENGTH_COMMUNITY. Uncomment the #define line. It should look like this afterwards: #define NO_ZEROLENGTH_COMMUNITY 1 Now compile PHP --with-snmp[=DIR]. part? Quote Link to comment https://forums.phpfreaks.com/topic/69885-problem-compling-php-with-snmp-php-524/#findComment-351496 Share on other sites More sharing options...
ramakuka Posted September 24, 2007 Author Share Posted September 24, 2007 welll , it's looks ok now but i have a new probelm during the compilation process this is the error : Undefined first referenced symbol in file sprint_objid ext/snmp/.libs/snmp.o sprint_value ext/snmp/.libs/snmp.o ld: fatal: Symbol referencing errors. No output written to sapi/cli/php collect2: ld returned 1 exit status *** Error code 1 make: Fatal error: Command failed for target `sapi/cli/php' any idea how can i resolve this ... BTW this is my configure command : ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-libxml-dir=/usr/local --with-config-file-path=/etc/apache2/ --with-mysql=shared,/opt/mysql/mysql/ --with-mysqli=shared,/opt/mysql/mysql/bin/mysql_config --with-bz2=/usr/lib --with-zlib --with-snmp=/usr/local/include/net-snmp/ --with-openssl-dir=/usr/local/ssl/ --without-pear --without-pgsql --enable-ucd-snmp-hack Quote Link to comment https://forums.phpfreaks.com/topic/69885-problem-compling-php-with-snmp-php-524/#findComment-353900 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.