ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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.
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"
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.