Nicholas Davey wrote: > Thankyou for the response. > > First, lemme just say you have been the first person to help out > without wanting a lot of source code that I would have to modify to > make suitable for use as a example. > > Now, first thing I need to address. The part about fopen(). That is > something done by the server my site runs on. I dont have access to > that server, seeing as how its not mine, so I can determin where my > script is exiting to cause this. And like I stated in another post, > my syntax is 100% correct, I have even had two other people check it > for me.
It's not a syntax problem; it's a permission problem. I assume you mean that you *can't* determine where your script is causing the fopen() to happen. I suggest you sprinkle "warn" statements throughout your script. The output of those will go to the server error log. If you just put: warn "TRACE"; at various points in your script, you'll see messages like this in the error log when you run your script. TRACE at index.cgi line 123. By doing this, you can narrow down exactly which line in your statement the script is dying at. > > And I know how stderr and stdout and stdin work for CGI. I wrote a > mini-cgi in college that parsed text files back to the net. (It > really sucked cause it was a group project, and the group I had were > total dumbasses). Needless to say, I still dont know whats going on. > Somtimes I get this error, sometimes I dont. Without knowing what the script is specifically doing, that's about all the help we can give. The fact that it's intermittent gives me an idea, but it's just a guess. Perhaps your umask is set to something strange that is causing the log file to be created, but not be writable? If you are creating files, be sure to set the umask to something reasonable like 022. > > Thankyou once again. > > Nicholas Davey > > > > www.vadtec.net > [EMAIL PROTECTED] > ----- Original Message ----- > From: "Bob Showalter" <[EMAIL PROTECTED]> > To: "'Nicholas Davey'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Wednesday, June 18, 2003 8:41 AM > Subject: RE: Problem with script headers. > > > > Nicholas Davey wrote: > > > Hi. > > > > > > Okay, I have been over my script about a hundred times, and > > > all my syntax is perfect. However, when I view my page on the > > > net, I get this: > > > > > > Internal Server Error > > > The server encountered an internal error or misconfiguration > > > and was unable to complete your request. > > > Please contact the server administrator, [EMAIL PROTECTED] > > > and inform them of the time the error occurred, and anything > > > you might have done that may have caused the error. > > > > > > More information about this error may be available in the server > > > error log. > > > > > > > > > > > > When I check the error log, I get this back (this is the last > > > three line of the error log, cause the last 50 entries are all > > > the same): > > > > > > > > > > > > failed to open log file > > > fopen: Permission denied > > > [Fri Jun 13 07:45:57 2003] [error] [client > > > 64.207.81.146] Premature end of script headers: <path removed > > > for security reasons>/cgi-bin/index.cgi > > > > When the server executes your CGI script, it directs STDERR > to the error > log > > file. It then executes your script and captures the STDOUT, > looking for > the > > MIME headers. It will add some more headers before sending > the response > back > > to the client. > > > > The first two lines above: > > > > failed to open log file > > fopen: Permission denied > > > > are being produced by your script. Presumably, your script > is calling > die() > > or exit() either directly or indirectly after emitting this message. > > > > The third line: > > > > [Fri Jun 13 07:45:57 2003] [error] [client 64.207.81.146] > > Premature end of script headers: path removed for security > > reasons>/cgi-bin/index.cgi > > > > is produced by the web server. Your script died before the > MIME headers > had > > been written, so the server was unable to find the headers > in the STDOUT > of > > your script. This error is also produced if your script has a > > syntax error (and thus dies during the compile phase). > > > > So, you need to find the point in your script where it's opening > > some kind of log file and deal with the permission violation. > > Remember that the web server runs under its own user id, so that > > user id will need appropriate permissions in the files and > > directories you're tyring to access here. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]