有人能解释为什么我的 perl 脚本呈现为纯文本吗:
#!/usr/bin/perl
use FindBin;
BEGIN {
lib->import($FindBin::Bin) unless $ENV{mod_perl}
}
require 'lsmb-request.pl';
我的目录指令如下:
Alias /ledgersmb /opt/ledgersmb/
<Directory /opt/ledgersmb>
RewriteRule ^/ledgersmb/?$ /ledgersmb/login.pl [R]
RewriteRule rest/(.*) /ledgersmb/rest-handler.pl/$1
Options +ExecCGI +FollowSymLinks
AllowOverride All
AddHandler cgi-script .pl
Require all granted
</Directory>
Apache 版本:
[dave@Threepwood opt]# sudo apachectl -v
Server version: Apache/2.4.23 (Unix)
Server built: Jul 5 2016 07:34:37
权限:
[dave@Threepwood ~]$ ls -l /opt/ledgersmb/setup.pl
-rwxr-xr-x 1 http dave 119 Aug 20 14:53 /opt/ledgersmb/setup.pl
[dave@Threepwood ~]$ ls -l /opt/ledgersmb/login.pl
-rwxr-xr-x 1 http dave 119 Aug 20 14:53 /opt/ledgersmb/login.pl
谢谢!
答案1
答案2
检查脚本是否可执行:
chmod +x path-to-script.pl