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!
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 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&
[8] 2506
[9] 2507
[10] 2508
[11] 2509
[12] 2510
[13] 2511
-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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.