# php 5.02 won't build, snmp error [solved]

## ryker

I took the plung and upgraded from php4 to php5.  I had it working for a week or so.  Then all of a sudden after a reboot, apache wouldn't start and gave some errors about php.  So I decided to re-emerge mod_php and now php won't compile.  I get the following error:

```
/var/tmp/portage/mod_php-5.0.2/work/php-5.0.2/ext/snmp/snmp.c: In function `netsnmp_session_set_sec_protocol':

/var/tmp/portage/mod_php-5.0.2/work/php-5.0.2/ext/snmp/snmp.c:795: error: `usmAES192PrivProtocol' undeclared (first use in this function)

/var/tmp/portage/mod_php-5.0.2/work/php-5.0.2/ext/snmp/snmp.c:795: error: (Each undeclared identifier is reported only once

/var/tmp/portage/mod_php-5.0.2/work/php-5.0.2/ext/snmp/snmp.c:795: error: for each function it appears in.)

/var/tmp/portage/mod_php-5.0.2/work/php-5.0.2/ext/snmp/snmp.c:799: error: `usmAES256PrivProtocol' undeclared (first use in this function)

/var/tmp/portage/mod_php-5.0.2/work/php-5.0.2/ext/snmp/snmp.c: In function `netsnmp_session_gen_auth_key':

/var/tmp/portage/mod_php-5.0.2/work/php-5.0.2/ext/snmp/snmp.c:822: warning: initialization discards qualifiers from pointer target type

/var/tmp/portage/mod_php-5.0.2/work/php-5.0.2/ext/snmp/snmp.c: In function `netsnmp_session_gen_sec_key':

/var/tmp/portage/mod_php-5.0.2/work/php-5.0.2/ext/snmp/snmp.c:851: warning: initialization discards qualifiers from pointer target type

make: *** [ext/snmp/snmp.lo] Error 1

make: *** Waiting for unfinished jobs....

!!! ERROR: dev-php/mod_php-5.0.2 failed.

!!! Function php5-sapi_src_compile, Line 432, Exitcode 2

!!! make failed

!!! If you need support, post the topmost build error, NOT this status message.

```

I had snmp in my use flags, so I took it out and I still get the same error message.  I searched the forum but I didn't see anything with the same error message I am getting.

Below is my make.conf

```
CFLAGS="-O2 -march=pentium3 -pipe -fomit-frame-pointer"

CHOST="i686-pc-linux-gnu"

USE="acpi4linux aliaschain apache2 clamav extensions fwdzone imap maildir \

     mcal mmx multipleip oav offensive php samba spamassassin sse \

     vhosts virus-scan vpopmail -oss -arts -avi -encode -gtk -gtk2 -kde \

     -gnome -mad -mikmod -motif -mpeg -oggvorbis -opengl -pdflib -qt \

     -quicktime -X -xmms -xv -imlib memlimit tokenizer sqlite xpm cpdflib \

     gd dba session tidy spl mime curl curlwrappers pcntl soap"

CXXFLAGS="${CFLAGS}"

ACCEPT_KEYWORDS="~x86"

MAKEOPTS="-j2"

GENTOO_MIRRORS="ftp://ftp.ussg.iu.edu/pub/linux/gentoo ftp://gentoo.chem.wisc.e$
```

I added "memlimit tokenizer sqlite xpm cpdflib \

     gd dba session tidy spl mime curl curlwrappers pcntl soap" to get php5 to work for me properly a week ago.

----------

## ryker

Does anyone have any suggestions for my problems, even if it involves re-doing half the system?  I'm just not sure where to start troubleshooting this.

----------

## tuxmin

Try -snmp in your use flags. If this does not help emerge snmp for god's sake and commit a bug report.

Hth, Alex!!!

P.S.: what tells you "emerge -vp mod_php"

is snmp used or not?

----------

## ryker

I had removed snmp from my use flags; however, it was still showing up with "emerge -vp mod_php".  Adding -snmp took it out properly.  It's compiling right now.  Hopefully it finishes.

I do have net-snmp installed.  I have even re-emerged it, but that didn't help.  I'll live without php snmp support.  I really need my squirrelmail.  :Smile: 

----------

## ryker

IT WORKED !!!!!    :Very Happy: 

I guess I'll worry about net-snmp later.  Has anyone else had any problems or luck with net-snmp and php 5?

----------

## wirwzd

The issue is with net-snmp 5.2 deprecating a couple of symbols. Emerge  <net-analyzer/net-snmp-5.2 or there should be an offical patch soon.

See https://bugs.gentoo.org/show_bug.cgi?id=72752

----------

## ryker

Thanks.  I guess I should learn to start checking the bugs site before posting.

----------

