[H-GEN] CGI Troubles.

Jason Henry Parker jasonp at uq.net.au
Mon May 14 10:18:47 EDT 2001


[ Humbug *General* list - semi-serious discussions about Humbug and  ]
[ Unix-related topics.  Please observe the list's charter.           ]
[ Worthwhile understanding: http://www.humbug.org.au/netiquette.html ]

Conor Cunningham <cunningham at uq.net.au> writes:

> I have my aliases in the httpd.conf file correct, well at least im
> pretty damn certain. All script have 755 as their permissions.

I think I'd need to see *some* of the httpd.conf to tell you what's
wrong.  Other posters might be more successful.

> Internal Server Error
> The server encountered an internal error or misconfiguration and was
> unable to complete your request.

Never bother with this.  Whenever you see this error, immediately
refer to the web server's error log.

> Can't open perl script "/var/www/cgi-bin/first.cgi": Function not
> implemented

That's very interesting.  I can't think what would cause that.  Can
you run the script from a shell?

> [Mon May 14 22:36:13 2001] [error] [client 127.0.0.1] Premature end of
> script headers: /var/www/cgi-bin/first.cgi

All this means is that (and I'm sure someone will correct me here)
basically the browser didn't receive a decent set of HTTP headers and
content to go along with it.

I know this isn't your perl code, but I can't resist:

> #!/usr/bin/perl
#!/usr/bin/perl -w

use strict;
> print "Content-type:text/html\n\n";

Um, I'm pretty sure a space is required after the colon, but a check
of the RFC (2068, section 4.2) doesn't support me.  Oh well.  There
may *well*, however, be issues with using Perl's \n.

> print << "ending_print_tag";

No quotes are required around heredoc terminators.

> <html><title>My first CGI</title>
> <background="#000000" text="#FF0000">
> </head><body>
> <h1> My First CGI </h1>
> <em> HELLO, INTERNET! </em>
> <hr noshade>
> Watch out cyber space, another programmer is on the loose ;-)
> </body></html>

No comment.

> ending_print_tag--

I'm assuming the `--' is supposed to be your sig delimiter and not
part of the script.

I'm constantly amazed at teachers who insist on `keeping things
simple' (the only reason I can see not to teach budding CGI coders
from using CGI.pm) feel justified to go ahead and use braindeadedness
like heredocs.

jason
-- 
||----|---|------------|--|-------|------|-----------|-|     |--||----|-|
| Jason Henry Parker                      play:        jasonp at uq.net.au |
| Available on #soc.bi on openprojects    work:  jparker at pisoftware.com |
||--|--------|--------------|----|-------------|------|---------|-----|-|

--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'.



More information about the General mailing list