in reply to Error trying to Run Perl script on IIS Server 8.5


print "Content-type: text/html \n\n";

The temporal difficulty with perl is u need to know C well to know its awesome.else u just keep *using* it and writing inefficient code
  • Comment on Re: Error trying to Run Perl script on IIS Server 8.5

Replies are listed 'Best First'.
Re^2: Error trying to Run Perl script on IIS Server 8.5
by marto (Cardinal) on Oct 29, 2014 at 12:21 UTC

    This has nothing to do with the issue. They are outputting plain text, not HTML.

Re^2: Error trying to Run Perl script on IIS Server 8.5
by masood91 (Novice) on Oct 29, 2014 at 12:11 UTC
    Still the same error!!!!......!!! I have already tried this, here is the complete code which i tried
    print "Content-type: text/html\n\n"; print "<html><head><title>Environment Dumper </title></head><body>"; print "<center><table border=1>"; foreach (sort keys %ENV) { print "<tr><td>$_</td><td>$ENV{$_}</td></tr>" } print "</table></center></body></html>";

      I assume this is your first CGI program.
      1.Try to isolate the problem you are facing by removing the other html tags.
      print "Content-type: text/html\n\n"; print "Hello World!\n";
      2. Run the program from the command line and see if it works.
      3. One common error is forgetting to make the file executable.
      4. If you have a log file on your IIS you might find more info there.
      5. Since you are returning the Content type as text/html , the headers will be properly constructed and sent back to the client by the webserver, provided, your exec Cgi environment is setup correctly. This means you dont have to write <html> </html>like tags for this.
      6. If you suspect a problem with your IIS server setup place an ordinary HTML file in the root directory and see if it is accessible from the browser.
      7. Also the first line of your OP code shows the path as #!/usr/bin/perl. I think would not readily compute under the windows IIS environment ?

      The temporal difficulty with perl is u need to know C well to know its awesome.else u just keep *using* it and writing inefficient code

        "7. Also the first line of your OP code shows the path as #!/usr/bin/perl. I think would not readily compute under the windows IIS environment ?"

        Incorrect.

        yes it is my first program, :) 1. I have dont that, same error 2. i have already run it with cmd, its running fine 3. how to make a file executable? i just saved it with the name otf test.pl 4. i dont know much about log file, i will see it 5. i didt understood this point :) 6. ordinary html files work fine. 7. ??