Chinaunix

标题: hello word的cgi程序居然有问题,请把我看看 [打印本页]

作者: 5417    时间: 2003-12-16 11:16
标题: hello word的cgi程序居然有问题,请把我看看
初学者,不怕丢人
a.pl
  1. #!/usr/bin/perl
  2. print "Content-type: text/html\n\n";
  3. print "Hello, World.";
复制代码


报错如下:
Server error!
The server encountered an internal error and was unable to complete your request.
Error message:
Premature end of script headers: a.pl
If you think this is a server error, please contact the webmaster
Error 500
192.168.0.35
Tue 16 Dec 2003 06:53:34 PM CST
Apache/2.0.40 (Red Hat Linux)

什么原因啊?请教了。
作者: cc007    时间: 2003-12-16 11:27
标题: hello word的cgi程序居然有问题,请把我看看
chmod 777 a.pl

try again! lucky!
作者: 5417    时间: 2003-12-16 11:29
标题: hello word的cgi程序居然有问题,请把我看看
兄弟:
没用啊,已经a+x过了。
作者: cc007    时间: 2003-12-16 11:38
标题: hello word的cgi程序居然有问题,请把我看看
RT
作者: apile    时间: 2003-12-16 12:22
标题: hello word的cgi程序居然有问题,请把我看看
print "content-type: text/plain\n\n";
作者: 5417    时间: 2003-12-16 13:14
标题: hello word的cgi程序居然有问题,请把我看看
严重感谢各位!

to:cc007
你太强了!!!!!!
是文件回车字符的问题。
作者: cc007    时间: 2003-12-16 14:00
标题: hello word的cgi程序居然有问题,请把我看看
不必客气 这方面的问题(dos<->;unix格式)很常见 有一些转换的工具 你可以用的
作者: 尚风    时间: 2004-05-11 15:16
标题: hello word的cgi程序居然有问题,请把我看看
谢谢!




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2