Hi,
I have CGI executable written in C++ and I have followed the steps given at http://community.activestate.com/forum-topic/configuring-perl-on-iis-7#comment-1022 to make the CGI setup ready. My perl scripts run fine with this minimal setup. However I am still not able to run the CGI executable.
I get following error in IIS 7.0 browser:
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 "Unrecognized character \x90 in column 3 at C:\inetpub\wwwroot\cgi-bin\CDTexample.cgi line 1. ".
Detailed:
Module CgiModule
Notification ExecuteRequestHandler
Handler CGI Script map
Error Code 0x00000009
Requested URL http://localhost:80/cgi-bin/CDTexample.cgi?atag=tag1&somedata=abc&ButtonCreate.x=24&ButtonCreate.y=22
Physical Path C:\inetpub\wwwroot\cgi-bin\CDTexample.cgi
Logon Method Anonymous
Logon User Anonymous
Even if I try to run from command line, I get same kind of error.
$perl -c CDTexample.cgi
Unrecognized character \x90 in column 3 at CDTexample.cgi line 1.
Code Snippet:
int main(void)
{
Report_Error("Neha ---My call successful.",0);
return 0;
}
static void Report_Error(const char* Error, int detail)
{
Supply_Headers();
printf("<HEAD>\r\n<TITLE>%s</TITLE></HEAD>\r\n<BODY>\r\n",Error);
printf("<br><font color=\"#FF0000\">%s</font><br>",Error);
if(detail !=0)
{
printf(" %d",detail);
}
printf("</BODY>\r\n</HTML>");
}
static void Supply_Headers()
{
printf("Content-Type:text/html\r\n");
printf("\r\n");
printf("<HTML>\r\n");
}
I am new to IIS and CGI scripts. Please guide.