虽然我可以从同一个位置运行test.cgi但是app.cgi给出了“内部服务器错误”。我查看了权限,为所有内容编了755。
该应用位于域根目录中,因此网址为domain.com/app.cgi
这是htaccess:
AddHandler cgi-script .cgi
Options +ExecCGI
IndexIgnore *
DirectoryIndex app.cgi
RewriteEngine on
RewriteRule ^$ app.cgi [L]
RewriteRule ^/$ app.cgi [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ app.cgi/$1
我真的很感激任何帮助。非常感谢!
答案 0 :(得分:3)
perl脚本中是否有错误?如果您的脚本无法编译,即使其他所有内容都配置正确,您也会收到内部服务器错误。
在任何其他输出之前,您的脚本是否打印标题(至少类似于Content-type: text/html\n\n
)?
您的服务器的错误日志应包含来自perl解释器或Web服务器的一些信息,说明CGI脚本无法运行的原因。
保持stackoverflow Perl-CGI故障排除指南方便: