2010-04-29 3 views
2

Je suis en train d'exécuter le script Perl exemple sur Windows 7 et je configuré IIS 7 pour permettre ActivePerl de courir, mais je reçois cette erreur:Pourquoi une erreur "Bad Gateway" s'affiche-t-elle avec mon programme Perl CGI sur IIS?

 
HTTP Error 502.2 - Bad Gateway 
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are "Hello World. ". 

Module CgiModule 
Notification ExecuteRequestHandler 
Handler Perl Script (PL) 
Error Code 0x00000000 
Requested URL http://localhost:80/hello.pl 
Physical Path C:\inetpub\wwwroot\hello.pl 
Logon Method Anonymous 
Logon User Anonymous 

et voici mon script Perl:

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

Répondre

7

La première sortie renvoyée par un programme CGI devrait être les en-têtes.

Essayez

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

Et puis garder ce lien pratique pour référence future: http://stackoverflow.com/questions/2165022/how-can-i-troubleshoot-my-perl-cgi-script – mob

+0

Remerciez vous tant ça fonctionne maintenant. – Eyla

Questions connexes