Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^3: Error trying to Run Perl script on IIS Server 8.5

by perlron (Pilgrim)
on Oct 29, 2014 at 12:16 UTC ( #1105451=note: print w/replies, xml ) Need Help??


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


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

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

    "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
        C:\>type derp.pl #!/usr/bin/perl print "Derp!\n"; C:\>derp.pl Derp! C:\>
Re^4: Error trying to Run Perl script on IIS Server 8.5
by masood91 (Novice) on Oct 29, 2014 at 12:35 UTC
    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
        "pls post the of the program execute from the command line we might be able to help you"........ post what?????

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1105451]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2020-02-20 08:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?










    Results (86 votes). Check out past polls.

    Notices?