LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Problem with perl and cgi files (https://www.linuxquestions.org/questions/linux-general-1/problem-with-perl-and-cgi-files-16812/)

JSP 03-22-2002 06:18 AM

Problem with perl and cgi files
 
I have an apache web server running in a linux platform. I put a perl and cgi file in the /usr/local/apache/htdocs so that users can access these two files andexecute it. The problem is when the user access to the perl file, a message prompts up asking user to store the file in which folder in their PC. What could be the possible problem? Why this is happening? Users suppose to execute the file. For the CGI file, the same thing happens but user can see the content of the file instead of running it or executing it.
I need help on this. Anyone.......

Bert 03-22-2002 08:01 AM

You should have a directory generated by the apache server program called cgi-bin. Put your CGI stuff in there.

The folder is usually /var/www/cgi-bin/

Access the stuff in your browser (probably) with

http://localhost/cgi-bin/slippydoo.cgi

Where slippydoo is the name of your perl file.

Also make sure the shebang !#/usr/bin/perl actually is where your perl executable resides. (The above is no good if perl is in /usr/include/perl !!)

Make sure that the environment varibales such as the document root in the perl file are defined (if there are any such variables, if there aren't, that's ok).

Bert


All times are GMT -5. The time now is 03:46 AM.