gpt4 book ai didi

perl - 为什么我在 IIS 上使用 Perl CGI 程序时会出现 "Bad Gateway"错误?

转载 作者:行者123 更新时间:2023-12-02 07:52:44 28 4
gpt4 key购买 nike

我试图在 Windows 7 上运行示例 Perl 脚本,并且我配置了 IIS 7 以允许 ActivePerl 运行,但我收到此错误:

HTTP Error 502.2 - Bad GatewayThe specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are "Hello World. ".Module  CgiModuleNotification    ExecuteRequestHandlerHandler Perl Script (PL)Error Code  0x00000000Requested URL   http://localhost:80/hello.plPhysical Path   C:\inetpub\wwwroot\hello.plLogon Method    AnonymousLogon User  Anonymous

and here is my Perl script:

#!/usr/bin/perl
print "Hello World.\n";

最佳答案

从任何 CGI 程序返回的第一个输出应该是标题。

尝试

#!/usr/bin/perl
print "Content-type: text/plain\n\n";
print "Hello World.\n";

关于perl - 为什么我在 IIS 上使用 Perl CGI 程序时会出现 "Bad Gateway"错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2741268/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com