in reply to Re: How do I get my webserver to execute Perl CGI scripts?
in thread How do I get my webserver to execute Perl CGI scripts?

I did everything that was suggested here and in referenced entries. I compiled the code and it's syntax was fine. I uploaded a test.cgi to check if perl was running and it worked without problem. I'm running on Windows with an Apache server if that makes a difference.
  • Comment on Re^2: How do I get my webserver to execute Perl CGI scripts?

Replies are listed 'Best First'.
Re^3: How do I get my webserver to execute Perl CGI scripts?
by wfsp (Abbot) on Sep 02, 2004 at 18:17 UTC
    Been there, got the teeshirt. It's like trying to stir your tea with a barge pole.
    If it's any help, this is what I did the last time I was there.

    At the begining of the script, send a message to the browser and exit.

    If that's ok, move the message down a bit and try again!

    Or

    Add a bit more code to the test.cgi.

    It that's ok, add a bit more!

    Have a look at the docs again and use CGI::Carp in test.cgi. Send plenty of output to the browser.

    Then (and only then!) post a short script that doesn't work here.

    This has saved my sanity many times! Best of luck.

      okay, i tried something really easy i found to check if perl was working correctly. i have an html that has
      <html> <head> <title>Tell Me Your Name</title> </head> <body> <form action="i:/oracle/isuites/apache/apache/cgi-bin/name.cgi"> <p>Enter your name:<input name="name" /></p> <p><input type="submit" value="Submit Me!"></p> </form> </body> </html>
      and the cgi has
      #!I:/ORACLE/iSuites/Apache/perl/5.00503/bin/MSWin32-x86/perl -w use strict; use CGI qw(:standard); print header; print start_html('Hello'); print "<h1>Hello, ", param('name'), "!</h1>\n"; print end_html;
      I is the correct drive for perl....I compiled the cgi and it worked fine. when i open the html and click submit it brings the perl to the browser.

        If you've setup apache to use a cgi-bin (which jbodoni already has explained), you should be able to call the cgi script with <form action="/cgi-bin/name.cgi" method=post>. That is as long as you've created the cgi-bin in your Document Root directory: the default of this is "/var/www/html", with cgi-bin being in "/var/www/cgi-bin". You can find out for sure by looking at httpd.conf.

        The fact that you looked at I: for the script makes me wonder if apache is even started/installed, test this by typing http://localhost/ into a browser.

        "Cogito cogito ergo cogito sum - I think that I think, therefore I think that I am." Ambrose Bierce