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

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>";

Replies are listed 'Best First'.
Re^3: Error trying to Run Perl script on IIS Server 8.5
by perlron (Pilgrim) on Oct 29, 2014 at 12:16 UTC

    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.


        u mean such a path would compute ? or it doesnt matter
      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. ??
        update
        pls post the of the program execute from the command line we might be able to help you.. 6. google how to make a file executable under windows. i think its some right click n change properties there.
        7. In unix ennviroment the first line you specify the path of the program that will execute your file. #!/usr/bin/perl points to the perl interpreter which would execute your perl script.
        I blieve in the windows environment its based on the file extension. so making it .pl and associating .pl with perl should do the job, provided your script has got executable permissions.
        Usually monks are not so verbose, bear in mind.

        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