Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CGI Error - Regarding Script Headers

Status
Not open for further replies.

riteshg

Programmer
Jun 12, 2001
1
US
I have a script which runs fine from the UNIX shell. As soon as I try going thru the browser, I get an error which says -
"Premature end of Script Header".

What should i do or what can i do ??

Please suggest some way to solve the issue.
 
best first guess is that the script is trying to do something that the web server process lacks sufficient priledges to do. When you run from a command prompt, it runs as you with your priveledges. When it runs via the web server it is running as the web daemon which is usually intentionally restricted in it's priveleges. Check anywhere that you are trying to open/read/change a file to see if the web daemon has sufficient access to that(those) file(s). The ""Premature end of Script Header" simply means the code did not run... consequently, the web server did not produce a valid HTTP header.

HTH


....might should take a look at the FAQs


keep the rudder amid ship and beware the odd typo
 
You should run this yuor-script as user no root.
1.Login as simple user.
2 Run your script : Lynx localhost/cgi-bin/your-script.cgi
If all right. Your script will run in any browser.
If error.
You should
1. login as root
2.copy your-script in directory localhost/cgi-bin
3. run command - chmod 755 your-script.cgi
And try again as simple user.

andrei@vap.baltnet.ru
Andrei Voronetski from Kaliningrad Russia.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top