我的perl程序报错,需要帮助,很着急
我在red hat linux as4 上安装好apache2.2.3
安装步骤是:
# tar xzvf httpd-2.2.3.tar.gz
# cd httpd-2.2.3
# ./configure --prefix=/usr/local/apache2 --enable-module=so --enable-mods-shared=all
# make
# make install
然后我在写了两个简单测试程序放在
/usr/local/apache2/cgi-bin/test.pl
/usr/local/apache2/cgi-bin/test.cgi
代码:
test.pl
------------------------
#!/usr/bin/perl
printf "hello ";
-----------------------
但这个程序一运行就报错如下:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, ddisremember@yahoo.com.cn and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
----------------------------------
但我不明白是什么原因会报错,请指教.谢谢
[解决办法]
换成下面的是否可运行
print "Content-type:text/html\n\n ";
print " <HTML> \n ";
print " <HEAD> \n ";
print " <TITLE> hello </TITLE> \n ";
print " </HEAD> \n ";
print " <BODY> \n ";
print "hello\n ";
print " </BODY> \n ";
print " </HTML> \n ";
[解决办法]
关键是少了这行:
print "Content-type:text/html\n\n ";
加到
printf "hello ";
这行前面就行。
[解决办法]
程序在我的FC5上没问题呀。是不是Apache的配置不正确。查一查Apache的错误文件error_log。
[解决办法]
部分服务器。。。对一些CGI的权限进行了限制。。。
ddisremember@yahoo.com。。我看到了这个。。yahoo支持的CGI有问题。。
[解决办法]
chmod 0755 test.pl
[解决办法]
权限不允许啊
试试chmod u+x test.pl
[解决办法]
嗯,同上,是权限不行引起的
我的异常网推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.myexception.cn/java-web/317.html