我创建httpd.conf中的以下别名运行:Perl脚本不能从一个别名
alias /aliasedfolder /some/location/on/the/server/folder
<Location /aliasedfolder>
AddHandler cgi-script .pl
Options +FollowSymLinks +ExecCGI
Order allow,deny
Allow from all
AllowOverride None
</Location>
的问题是,我可以在“aliasedfolder”查看图像,但我得到一个“文件不不存在“的错误,当我在那里运行一个Perl脚本,例如/aliasedfolder/script.pl。 物理perl脚本存在于“/ some/location/on/the/server /文件夹中”。 我确保脚本拥有755权限。
下面是Perl脚本的内容:
#!/usr/bin/perl
use CGI qw/:standard/;
print "Content-type:text/html;\n\n";
print "Hello world";
1;
出了什么问题? 谢谢
您检查了脚本的权限,但是您没有提及任何有关它所在的目录链的信息.apache运行的程序需要能够访问脚本所在的目录。不知道这是否是问题。 – ikegami
/some/location/on/the/server/folder/script.pl –
ikegami意味着您需要检查Apache用户是否需要具有读取路径中所有目录的权限。 Apache阅读器可以访问/ some,/ some/location,/ some/location/on等... –