Hi I have some simple script within the context of a cgi script that create a file to write to. If I run the script from the command line as root the file is created with no issue. However when I run the script from a web page with the apache account, it dies. The code lines are:
sub Populate_Session_File {
open (NEWOUT,">/var/www/cgi-bin/sessions/$SID") || die "can't open the sessions file";
print NEWOUT "$SID\011$empnum\011$first_name\011$last_name\011$mailadder\n";
close (NEWOUT) || die "can't close the spaceout file";
} # end populate session File
And the error I get is:
"[Tue Mar 12 06:07:58 2013] [error] [client IP] can't open the sessions file at /var/www/cgi-bin/riskpect_dsp_login.pl line 238., referer: http://blah.blah
[Tue Mar 12 06:07:58 2013] [error] [client IP] Premature end of script headers: riskpect_dsp_login.pl, referer: http://blah.blah
"
Thanks in advance for any help