[Xitami] using cgi with Xitami
Vera Cranor
xitami@lists.xitami.org
Mon, 09 Feb 2004 01:55:09 -0600
I have xitami 2.4 and it worked great with Win 95 and 98. I use an older
version of Perl and that worked fine with Xitami also.
Now I have new puter and Win XP. The Xitami server will serve web pages
like it did,
but when I call a Perl script with the browser Xitami doesn't return the
Perl output. I get a blank page.
The access log shows this:
127.0.0.1 - - [09/Feb/2004:01:15:53 -0600] "GET /cgi-bin/xtest.cgi
HTTP/1.1" 200 0 "" ""
The error log is empty.
The script writes a file just before exiting, and that worked so I know
the script ran.
However, the output got lost somewhere and a blank page was returned.
Here's the script (xtest.cgi):
#!/usr/bin/perl
print "content-type: text/html\n\n";
print <<end;
<html><body><center>test</center></body></html>
end
open(F, ">xtest.txt");
print F "okedoke";
close F;
exit;
The script created the file, xtest.txt, so I know the script ran.
I expected to get a page back with just the word "test" at the top.
Instead, the page is blank, here is the html code for what is returned:
Here's the page source, which did not come from the script:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html;
charset=windows-1252"></HEAD>
<BODY></BODY></HTML>
As you can see, what is returned is quite different from what the script
output.
So it seems to me that the Perl output got lost and I don't know where
the file
that was returned came from.
Here's what I get back when I run the script in the DOS box:
content-type: text/html
<html><body><center>test</center></body></html>
That's what I should get when I call the script from the browser.
I have tried changing the XP "compatibility" setting to run Xitami in 95
& 98/ME modes but that didn't help.
I don't know what to do to get Xitami to capture the output of Perl and
return it to the browser.
Thanks for any help,
Vera