Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 11-06-2003, 07:45 PM   #1
Registered: Dec 2002
Posts: 56

Rep: Reputation: 15
Have problem running .pl perl script in apache

my linux is RH9.0
apache 1.3.29

here is some directives I added to httpd.conf to work with perl script

ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"

<Directory "/usr/local/apache/cgi-bin">
AllowOverride None
Options FollowSymLinks +ExecCGI
Order allow,deny
Allow from all

AddHandler cgi-script .pl .cgi

And here is my testing perl script

print "Content-type: text/plain\n\n";
print "perl script run properly!\n";

My question is, if the perl script with a .pl extension, web browser just ask me to save the script. However without a .pl extension or with .cgi extension, the script can run properly.

who knows what's the problem ? Anything wrong on my httpd.conf ?
Old 11-06-2003, 08:21 PM   #2
LQ Guru
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 261Reputation: 261Reputation: 261
After adding the .pl did you restart the apache server so it knows to recognize those as an executable script, etc?
Old 11-06-2003, 09:22 PM   #3
Registered: Dec 2002
Posts: 56

Original Poster
Rep: Reputation: 15
yes sure. I restarted apache
Old 11-09-2003, 10:51 PM   #4
LQ Newbie
Registered: Nov 2003
Posts: 9

Rep: Reputation: 0
Did you perhaps forget to set the perl script as executable? Also note that the script would have to be executable by the user that apache runs as!.
Old 11-10-2003, 09:31 AM   #5
Registered: Dec 2002
Posts: 56

Original Poster
Rep: Reputation: 15
i have made the script executable and apache should have permission to run the script


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Running a Perl script with SendMail NewByy Linux - Newbie 4 08-25-2005 01:02 PM
Running a perl script bobfinners Linux - Software 1 06-23-2005 05:18 PM
running perl script dav_y2k Linux - Newbie 3 04-25-2005 05:00 AM
Apache CGI Problem : Browser not running script Zaknafien Linux - Software 3 12-31-2003 01:16 PM
Perl script not running on FreeBSD J_Szucs *BSD 12 07-13-2002 09:05 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:32 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration