I have set my script permissions to 755, 777, and many other settings. I use
755 beacuase thats the right one to use for the net.

I tell you to not worry about the path because I dont really want the path
on my server revealed for security reasons. All that matters is that the
script is in my cgi-bin directory and is named index.cgi

As for the content type header, I use a common print function to do this,
and this function works on every other page that uses this function (which
is in a package named VADTEC):

sub printHeader() {
 print "Content-type: text/html\n\n";
 print "<!--" .ns() . "Custome site built by Nicholas R. Davey." . ns() .
"Custom PERL script written to build the custom site." . ns() . "-->" .ns();
}

And dont worry about the ns() function, that is a formatting function I use
for debuging my HTML code. If you want to know, it either returns a tab, a
space, or a newline. Thats all it does.

So, at the top of my index.cgi, I setup the packages I need to use, setup
some variables, assign values to those variables, and the very first thing I
do is call printHeader(). So you see, when this function works with the
following list of other files (which only I have access to), and it still
works, there has to be something going on. Cause I get this error from
friends who live in Asia, Europe, etc. So its not just me.

List: news.cgi, open.cgi, login.cgi, home.cgi, zip.cgi, cloute.cgi, and
about 30 others

All these files are chmod 755, as are the directories they are contained in,
and the ones above them as well.

I hope I gave you enough info to maybe see why index.cgi is the only
freaking page that doesnt work.

www.vadtec.net
[EMAIL PROTECTED]

P.S. Dont bother trying to find the pages I listed above, they are in a pwd
proceted dir and aren't accessible by but just a few people arrond the
world.

----- Original Message -----
From: "Scot Robnett" <[EMAIL PROTECTED]>
Newsgroups: perl.beginners.cgi
To: "Nicholas Davey" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, June 15, 2003 1:26 AM
Subject: RE: Problem with script headers.


> What are the permissions set to? Have you chmod'd to 755 (-r-x)?
Permission
> will be denied unless the script is set to executable.
>
> How can we verify that your content headers are perfect unless you post
the
> code? You tell us not to worry about the path and ask us to figure out
what
> could be wrong, but you're not giving us anything to look at except an
error
> message.
>
> It could be as simple as missing the space in a line like
>
> print "Content-type:text/html\n\n";  # wrong
> print "Content-type: text/html\n";   # also wrong
> print "content-type: text/html\n\n"; # still wrong
> print "Content type: text/html\n\n"; # no dice here either
> print "Content-type: text/html\n\n"; # correct
>
> Of course, if you're using the CGI or CGI::Simple module, then the headers
> can be more easily created and they are more likely to be error-free...
>
> print $query->header();
>
> or
>
> print $query->header(-title=>'foo',
>                            -BGCOLOR=>'white');
>
> -----
> Scot Robnett
> inSite Internet Solutions
>
>
>
> -----Original Message-----
> From: Nicholas Davey [mailto:[EMAIL PROTECTED]
> Sent: Friday, June 13, 2003 9:46 AM
> To: [EMAIL PROTECTED]
> Subject: Problem with script headers.
>
>
> 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
>
>       Don't worry about the path. All that matters is what could be wrong.
> If my syntax in 100% correct, and I return the proper Content-type
headers,
> what's the deal? Any comments would be great.
>
>
> www.vadtec.net
> [EMAIL PROTECTED]
>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to