Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_php thread: Placing cgi files on Linux


Message #1 by "arun" <arun@l...> on Tue, 2 Apr 2002 14:26:26 -0800
Howdy,

> Can any one help me in executing a .cgi file.?

> Actually for php to work we are placing it in /var/www/html/ or
> /usr/local/apache/htdocs/(while installing with open source), likewise for
> cgi file were to place.

There're a few things you must do in order to execute a cgi script.
Since I don't know what you have or haven't done, I'll just list them all.

1. Make sure that your script has the proper execution line at the top of
    yourscript. (IE: #!/usr/bin/perl)
2. Your script needs to be placed in a cgi-bin directory as configured in
    your httpd.conf. (or other appropriate files)  In Apache this is
    /usr/local/apache/cgi-bin/ by default.
3. And last, your script should be executable.  (IE: chmod +x testscript.pl)

And of course, you need to send the correct header information at the
beginning of your script.  (Content-type: text/html, and such)

Something else that might help you is '/usr/local/apache/logs/error_log'.
It provides some pretty detailed logging for cgi errors.

Hope I could help,

Scott.



  Return to Index