使用Windows 10上的Bitnami WAPP堆栈本地开发在Linux / CentOS上部署的站点。堆栈不包括Perl,站点中需要运行一些Perl脚本。
我已经将Bitnami WAPP堆栈安装到D:\Bitnami\wappstack-7.1.25-0
,并且该站点的运行状况几乎与http://localhost:86
一样,但是根index.html
具有旧式计数器图像元素
<P><IMG SRC="/cgi-bin/counter.pl/index.gif" ALT="Counter"></P>
显示由Perl动态生成的gif。
因此,我使用默认值安装了ActiveState Perl。安装程序将Perl放在C:\Perl64
。 Apache httpd.conf
已编辑为具有
ScriptAlias /cgi-bin/ "D:\Projects\mysite.com\ROOT\cgi-bin\"
<Directory "D:\Projects\mysite.com\ROOT\cgi-bin">
AllowOverride None
Options None
Require all granted
</Directory>
counter.pl
脚本具有
#!/usr/bin/perl -w
…
use HTTP::Date;
所以我创建了文件夹
D:\usr\bin
以“模拟” shebang / usr / bin目录。在D:\usr\bin
中,我添加了两个链接:
mklink perl.exe c:\Perl64\bin\perl.exe
mklink perl526.dll c:\Perl64\bin\perl526.dll
因此,此时开发站点索引页面正在运行counter.pl脚本,但是显示error.log
[Sat Jan 19 23:38:23.785649 2019] [cgi:error] [pid 24892:tid 1248] [client ::1:51218] End of script output before headers: counter.pl, referer: http://localhost:86/index.html
[Sat Jan 19 23:38:23.785649 2019] [cgi:error] [pid 24892:tid 1248] [client ::1:51218] AH01215: Can't locate HTTP/Date.pm in @INC (you may need to install the HTTP::Date module) (@INC contains:) at D:/Projects/mysite.com/ROOT/cgi-bin/counter.pl line 49.\r: D:/Projects/mysite.com/ROOT/cgi-bin/counter.pl, referer: http://localhost:86/index.html
[Sat Jan 19 23:38:23.785649 2019] [cgi:error] [pid 24892:tid 1248] [client ::1:51218] AH01215: BEGIN failed--compilation aborted at D:/Projects/mysite.com/ROOT/cgi-bin/counter.pl line 49.\r: D:/Projects/mysite.com/ROOT/cgi-bin/counter.pl, referer: http://localhost:86/index.html
ActivePerl安装中肯定具有C:\ Perl64 \ lib \ HTTP \ Date.pm,所以我试图找出方法之一:
我不想更改shebang线,因为最终部署回Centos时必须再次更改。