ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.