1 Oct 2003 02:14
Re: Debian 3.0r1 Apache 1.3.26 cgi-bin behavior depends on script name and browser (?)
Brian Dessent <brian <at> dessent.net>
2003-10-01 00:14:36 GMT
2003-10-01 00:14:36 GMT
David Christensen wrote: > And here is one that Mozilla attempts to download, while IE says "The > page cannot be found": > > dpchrist <at> d3020g:~/public_html/cgi-bin:CVS> cat intro3.pl > #!/usr/bin/perl -w > use strict; > > print "Content-Type: text/html\n\n"; > > print <<END; > <html> > <head><title>My Page Title</title></head> > <body><p>My page body</p></body> > </html> > END > exit(0); You need to use \r\n for line endings in the HTTP headers, not \n. This is exactly the sort of reason why you should always use CGI.pm and not try to handle HTTP headers, forms, encoding, etc. with code that your write. It's almost guaranteed that there is always some minor thing that will break "home brewed" scripts that is handled properly by CGI.pm. Brian ---------------------------------------------------------------------(Continue reading)
I already tried newline expansion -- no effect. I get the same wrong
behavior whether I use my original version of the script:
dpchrist <at> d3020g:~/public_html/cgi-bin$ cat intro3.pl
#!/usr/bin/perl -w
use strict;
print "Content-Type: text/html\n\n";
print <<END;
<html>
<head><title>My Page Title</title></head>
<body><p>My page body</p></body>
</html>
END
exit(0);
dpchrist <at> d3020g:~/public_html/cgi-bin$ perl intro3.pl
Content-Type: text/html
<html>
<head><title>My Page Title</title></head>
<body><p>My page body</p></body>
What are the permissions and user/group of all these script files? Try
making them all 755 and see if that changes anything. And what user is
Apache running as, and is suexec in use?
Brian
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:
RSS Feed