in reply to CGI Question

You need to configure Apache to handle that files. The following AddHandler directive tells the server to treat all files with the cgi or pl extension as CGI programs:
AddHandler cgi-script cgi pl
After putting your CGI running read about mod_perl for better performance.
«A contentious debate is always associated with a lack of valid arguments.»

Replies are listed 'Best First'.
Re^2: CGI Question
by Irishboy24 (Sexton) on Jul 20, 2009 at 17:56 UTC
    Hey Thank you for the quick reply. i checked the httpd.conf file and surel +y enough the "Addhandler" was commented out. i added ur option and th +en tunrned on CGI in the options directive. I restarted Apache and th +en launched the browser. now it gives me an internal server error pro +blem. i went into the apache logs and this is the error it shows "The system cannot find the file specified. : couldn't spawn child p +rocess: C:/Documents and Settings/Maddy17/My Documents/mywebsite/env. +cgi" Now i went back to the document root dir and checked if the file was p +resent. the file exists there so i am not sure what to do now.
    Thanks

      If Apache can't find the file you may have either a permissions problem, a problem in your config file, or some bad .htaccess directives.

      • Does the Apache server have the right to view files in the directory where the symbolic link resides? If not, the file will be invisible to Apache even though you can see it.
      • How have you mapped server URLs to file system paths? Check your mod_rewrite directives. Are they doing what you think they do? You can monitor the rewrite process by looking at the log files (see the RewriteLog and RewriteLogLevel directive). Look also for Location, LocationMatch, Files and FilesMatch directives. You should also check mod_alias directives, in particular, ScriptAlias and ScriptAliasMatch. mod_alias and the other directives all tell Apache how to convert URLs to system file paths.
      • Is the file symbolically linked to some other file elsewhere on the system? If so, you will either need to insure that FollowSymLinks is turned on for that directory or to replace the symbolic link with an actual copy. The more secure solution is to copy the file. Turning on symbolic links makes you more vulnerable to certain kinds of malicious attacks.

      Best, beth

        Hey Beth, Thank you for the quick reply. i reset the apache r/w to deafult and i can execute my script now .
      Could you run the cgi on the cmd line?
      c:> my_cgi.pl
      Make sure the path to perl is correct.
      #!"C:\path\to\perl"