发新话题
打印

初学CGI,浏览器无法执行perl,提示出错,如何解决?

初学CGI,浏览器无法执行perl,提示出错,如何解决?

初学CGI/PERL,使用环境为Redhat9+Apache
按照教程建立一个简单的test.cgi文件如下:

#!/usr/bin/perl
#
# Program to do the obvious
#
print 'Hello world.';
# Print a message

并将该文件防到/var/www/cgi-bin目录下,chmod为a+rx.
可是当我通过浏览器访问

http://IP地址/cgi-bin/test.cgi时却显示出错信息如下:
The server encountered an internal error and was unable to complete your request.
Error message:
Premature end of script headers: test.cgi
请问是什么原因?如何解决?      

TOP

发新话题