Find the answer to your Linux question:
Results 1 to 2 of 2
Hey guys, hoping you can help me out with a recent problem. This morning I set about installing Cacti, haven't had much success and it appears that the problem is ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2009
    Posts
    1

    Unable to compile SNMP in PHP5.2.8


    Hey guys, hoping you can help me out with a recent problem.

    This morning I set about installing Cacti, haven't had much success and it appears that the problem is likely that SNMP is not compiled in PHP. (I do have snmp & snmpd installed via the apt-get system.)

    So, I set about recompiling PHP with the "--with-snmp" flag, but I get the following error:
    Code:
    checking for SNMP support... yes
    checking OpenSSL dir for SNMP... no
    checking whether to enable UCD SNMP hack... no
    checking for net-snmp-config... /usr/bin/net-snmp-config
    checking for snmp_parse_oid in -lnetsnmp... no
    checking for init_snmp in -lnetsnmp... no
    configure: error: SNMP sanity check failed. Please check config.log for more information.
    The config.log shows the following
    Code:
    configure:87422: checking for SNMP support
    configure:87469: checking OpenSSL dir for SNMP
    configure:87495: checking whether to enable UCD SNMP hack
    configure:87523: checking for net-snmp-config
    configure:88779: checking for snmp_parse_oid in -lnetsnmp
    configure:88798: gcc -o conftest -I/usr/local/include -g -O2  -L/usr/local/lib  -Wl,-rpath,/usr/local/lib -L/usr/local/lib -Wl,-rpath,/usr/local/mysql/lib -L/usr/local/mysql/lib conftest.c -lnetsnmp  -lrt -lmysqlclient -lmhash -lmcrypt -lltdl -liconv -lfreetype -lpng -lz -ljpeg -lcurl -lz -lresolv -lm -ldl -lnsl  -lxml2 -lz -liconv -lm -lssl -lcrypto -lcurl -lxml2 -lz -liconv -lm -lssl -lcrypto -lmysqlclient -lz -lcrypt -lnsl -lm -lmygcc -lmysqlclient -lz -lcrypt -lnsl -lm -lmygcc -lxml2 -lz -liconv -lm -lnetsnmp 1>&5
    /usr/bin/ld: cannot find -lnetsnmp
    collect2: ld returned 1 exit status
    configure: failed program was:
    #line 88787 "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:88932: checking for init_snmp in -lnetsnmp
    configure:88951: gcc -o conftest -I/usr/local/include -g -O2  -L/usr/local/lib  -Wl,-rpath,/usr/local/lib -L/usr/local/lib -Wl,-rpath,/usr/local/mysql/lib -L/usr/local/mysql/lib conftest.c -lnetsnmp  -lrt -lmysqlclient -lmhash -lmcrypt -lltdl -liconv -lfreetype -lpng -lz -ljpeg -lcurl -lz -lresolv -lm -ldl -lnsl  -lxml2 -lz -liconv -lm -lssl -lcrypto -lcurl -lxml2 -lz -liconv -lm -lssl -lcrypto -lmysqlclient -lz -lcrypt -lnsl -lm -lmygcc -lmysqlclient -lz -lcrypt -lnsl -lm -lmygcc -lxml2 -lz -liconv -lm -lnetsnmp 1>&5
    /usr/bin/ld: cannot find -lnetsnmp
    collect2: ld returned 1 exit status
    configure: failed program was:
    #line 88940 "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; }
    Which isn't telling me much more, basically looks like the problem is with /usr/bin/ld: cannot find -lnetsnmp...but I have no idea how to proceed from here.



    Thanks for the help!

  2. #2
    Linux User Daan's Avatar
    Join Date
    Aug 2005
    Location
    The Netherlands
    Posts
    323
    Quote Originally Posted by TheCodeman View Post
    Which isn't telling me much more, basically looks like the problem is with /usr/bin/ld: cannot find -lnetsnmp...but I have no idea how to proceed from here!
    I'm not sure I know better than The Codeman, but it looks like you are missing some library. Have you Googled the error message? Find out which development package contains the missing library and apt-get it.
    OS's I use: Debian testing, Debian stable, Ubuntu, OpenSuse 12.1, Windows 7, Windows Vista, Windows XP

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •