【发布时间】:2018-01-30 03:26:15
【问题描述】:
我不确定这是否是提出这个问题的正确地方。但是我无法让我的 cgi 脚本在我的 XAMPP 服务器上运行(使用 windows 8 和 apache)这是我的 cgi 脚本:
#!usr/bin/perl
use warnings;
use diagnostics;
use strict;
my $time = localtime;
my $remote_id = $ENV{REMOTE_HOST} || $ENV{REMOTE_ADDR};
my $admin_email = $ENV{SERVER_ADMIN};
print <<END_OF_PAGE;
<HTML>
<HEAD>
<TITLE>Welcome to Mike's Mechanics Database</TITLE>
</HEAD>
<BODY BGCOLOR="#ffffff">
<IMG SRC="/images/mike.jpg" ALT="Mike's Mechanics">
<P>Welcome from $remote_host! What will you find here? You'll find a list of mechanics
from around the country and the type of service to expect -- based on user input and
suggestions.</P>
<P>What are you waiting for? Click <A HREF="/cgi/list.cgi">here</A>
to continue.</P> <HR> <P>The current time on this server is: $time.</P>
<P>If you find any problems with this site or have any suggestions,
please email <A HREF="mailto:$admin_email">$admin_email</A>.</P>
</BODY>
</HTML>
END_OF_PAGE
这是我得到的完整错误:
**服务器错误! 服务器遇到内部错误,无法完成您的请求。 错误信息: 无法创建子进程:720002:welcome.cgi 如果您认为这是服务器错误,请联系网站管理员。 错误 500 本地主机 Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/5.6.30
最后,这里是apache错误日志中的条目,对应问题
[Mon Aug 21 20:46:19.403512 2017] [cgi:error] [pid 1436:tid 1724] (OS 2)系统找不到指定的文件。 : [client ::1:61381] 无法创建子进程:720002:welcome.cgi,referer:http://localhost/Perl/
[Mon Aug 21 20:46:19.404515 2017] [cgi:error] [pid 1436:tid 1724] (OS 2)系统找不到指定的文件。 : [client ::1:61381] AH01223: 无法生成子进程:C:/xampp/htdocs/Perl/welcome.cgi,引用者:http://localhost/Perl/
【问题讨论】: