Error - Premature end of script headers for C CGI Files
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I guess you get the error from a webserver. You can check the webserver's error log for hints and also try to run the cgi from CLI and see if it produces valid HTML.
Most likely you'll need the sources to recompile it for linux.
755 is generally OK, but in your case since you use RHEL it might be a SELinux problem, preventing the cgi to run correctly. That's why I'm telling you to run it from command line and see what it outputs. Better yet, run it as the user running apache.
It gives the the error as follows
[root@odn235 src]# ./date.cgi?mode=date&b1=255&b2=255&b3=255&s1=0&s2=0&s3=0&tp=bg&
-bash: ./date.cgi?mode=date: No such file or directory
The CGI's were running on HP - UNIX 32 bit machine.
It should be better run it as the apache user. Most likely it cannot find the directory to write the image or something like that. Are you sure it's not a SELinux problem?
Could you post the code here, so someone familiar with C more than me could help?