apache24韩元';不要运行cgi脚本

apache24韩元';不要运行cgi脚本,apache,perl,Apache,Perl,httpd错误。日志: [Sat Jul 18 17:30:22.505894 2015] [cgi:error] [pid 30498] [client 24.224.147.251:40394] AH01215: env: perl: No such file or directory: /srv/http/forum.fgfugees.ca/htdocs/cgi-bin/test.cgi [Sat Jul 18 17:30:22.505987 2015] [cgi:error] [pid

httpd错误。日志:

[Sat Jul 18 17:30:22.505894 2015] [cgi:error] [pid 30498] [client 24.224.147.251:40394] AH01215: env: perl: No such file or directory: /srv/http/forum.fgfugees.ca/htdocs/cgi-bin/test.cgi

[Sat Jul 18 17:30:22.505987 2015] [cgi:error] [pid 30498] [client 24.224.147.251:40394] End of script output before headers: test.cgi
该文件确实存在,我可以通过键入

/usr/bin/env perl /srv/http/forum.fgfugees.ca/htdocs/cgi-bin/test.cgi 
进入我的CLI

httpd.conf:

我正在forum.fgfugees.ca虚拟主机下测试脚本,该虚拟主机从第287行开始


脚本位于:/srv/http/forum.fgfugees.ca/htdocs/cgi-bin/

test.cgi:

#!/usr/bin/env perl

print "Content-type: text/html\n\n";
print "sup bitch";

由于某种原因,Apache无法运行/usr/bin/env perl


我使用shebang行
#绕过了某种权限错误/usr/local/bin/perl
相反,在shell的登录脚本中,您可以更改路径,允许从shell定位
perl
。但只能从你的壳里。替换

/usr/bin/env perl
在shebang行中,使用
perl
的实际路径

type -p perl


可能会帮助您确定该路径。

test.cgi脚本在哪里?脚本位于:/srv/http/forum.fgfugees.ca/htdocs/cgi-bin/I,我想分享
test.cgi
。无论如何,将shebang行修改为
#/usr/bin/env perl
。然后检查一次。检查文件源的新编辑
ls-la/usr/bin/perl
ls-la/srv/http/forum.fgfugees.ca/htdocs/cgi-bin/test.cgi
which perl