LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 12-09-2004, 05:42 PM   #1
alvo
LQ Newbie
 
Registered: Dec 2004
Posts: 2

Rep: Reputation: 0
PERL script OK at command line, not in browser


I'm attempting to install a simple PERL script. I've tried it on two servers, with the same results on both. If I run the script from the commant line it works fine. When accessing it from a browser all I get output is the text of the file.

Permissions are set correctly on the file (755) and directory (777) it resides in. It's running in the HTML directory of my site (as recommended by the script's author) rather than the cgi-bin, but my server is set up to allow that and I have another script in the same place that works.

Path to perl is correct in the script. print "Content-type: image/gif\n"; is in the script. The file extension is .cgi and that works elsewhere. Syntax checks OK.

Server is running RH Linux/Apache

I'm missing something obvious, I'm sure. I've been searching around the web for an answer, but haven't managed to figure out search terms to use that could lead me to an answer (I get hundreds of pages about other errors).

I'd really appreciate any thoughts you might have.
 
Old 12-09-2004, 07:39 PM   #2
sigsegv
Senior Member
 
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197

Rep: Reputation: 46
Do you have the ExecCGI option set on that directory? Why not just run it in cgi-bin?
 
Old 12-09-2004, 07:50 PM   #3
ronferns
LQ Newbie
 
Registered: Nov 2004
Location: Goa, India
Distribution: Fedora Core 1
Posts: 22

Rep: Reputation: 15
i see that you have a line saying "Content-type: image/gif\n"
if that's the last header line printed by your script prior to printing the gif then it should have another "\n". i e. "Content-type: image/gif\n\n"
 
Old 12-09-2004, 07:56 PM   #4
sigsegv
Senior Member
 
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197

Rep: Reputation: 46
While the "\n\n" issue is correct, that would cause a 500, not the source of the page being served.
 
Old 12-19-2004, 08:28 AM   #5
neilman
Member
 
Registered: Oct 2004
Location: Northville, MI
Distribution: Slackware
Posts: 65

Rep: Reputation: 15
Look at your Apache error log file. And yes, you'll need to make sure that ExecCGI is on, or that the file lives in a directory (i.e. /cgi-bin) where CGIs are allowed to be executed. Your issue isn't OS-side permissions, it's Apache configuration permissions.
 
  


Reply


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
unable to run perl script using browser madhuri Debian 3 12-02-2005 04:46 PM
unable to run perl script using browser madhuri Linux - Distributions 1 11-22-2005 02:19 PM
need to control a browser from the command line nephish Linux - Software 6 11-21-2005 05:55 PM
Perl shell-out to script dunna work. Works on command line. Why? jlangelier Linux - Software 1 08-28-2004 02:00 AM
Command-Line Browser JoshSmith41 Linux - Software 6 01-08-2004 12:42 PM


All times are GMT -5. The time now is 03:28 PM.

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