Andreas Ericsson wrote:
Ahoy. List newbie here.

I've run into the exact same problem the user over at http://www.manucorp.com/archives/php-bugs/200504/msg00325.php seems to have encountered (running php with snmp enabled as module). After
<snip>
For the next question, we need to look at the output a bit (this is from running a PHP-script btw. The regular apps don't seem to be so troublesome).
--%<--%<--%<---
No log handling enabled - turning on stderr logging
Cannot rename /var/net-snmp/snmpapp.conf to /var/net-snmp/snmpapp.0.conf
Cannot unlink /var/net-snmp/snmpapp.conf
read_config_store open failure on /var/net-snmp/snmpapp.conf
read_config_store open failure on /var/net-snmp/snmpapp.conf
read_config_store open failure on /var/net-snmp/snmpapp.conf
--%<--%<--%<--

It looks like PHP is using persistent storage. See:

http://www.net-snmp.org/docs/FAQ.html#What_s_the_difference_between__var_ucd_snmp_and__usr_local_share_snmp_

In ext/snmp/snmp.c in the PHP 4.3.11 source file, starting at line 184 you'll see that it initializes snmp using the name "snmpapp" and there are 15 persistent variables. So that would explain why it is trying to write to the /var/net-snmp folder.

If you don't want it to write to /var/net-snmp, then try setting the SNMP_PERSISTENT_FILE environment variable to something that the user running PHP has write access to. For example, create /var/net-snmp-php and give the user write access to the folder, then set

SNMP_PERSISTENT_FILE=/var/net-snmp-php/snmpapp.conf

I would only set this variable for the process running PHP. Otherwise, if you run snmpd, it would also redirect snmpd's persistent file to that location.

Alex




------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to