# Error with CGI script



## Suzanne

Can anyone tell me what "Premature end of script headers" might mean? I'm trying to install a cgi script and it's not working


----------



## ian

It could possibly be that the permission settings (eg CHMOD 755) are not correctly set.
Also the script files need to be uploaded in ASCII.


----------



## ian

Did you make sure that the perl path was correct? Did you use notepad to edit the file?


----------



## whatsmydingo

whenever I got that error it meant that I either forgot my #! or 
print "Content-type:text/html\n\n";


----------



## zkiller

make sure the line at the very top of the script, that declares where perl is, is correct.


----------



## Christopher

Double check the path to perl is correct (as ian said). Should look like this (at the very top, as z has suggested):


		Code:
	

#!/usr/bin/perl


Your host may be different though, look through your hosts FAQ or ask them.

Then make sure it's CHMOD'd to 755 and uploaded in ASCII as ian said and ensure the directory is also CHMOD'd to 755.

But that error should mean that your headers weren't sent properly, make sure you found the line that whatsmydingo said. It might have "\n\r\n\r" instead of "\n\n".


----------



## Suzanne

Thanks guys, as far as I know all of that was done right so I've given up with that script  I hate CGI scripts.


----------



## whatsmydingo

If you want I can try and help you out, personally I like perl


----------



## Christopher

You sure you had it in your cgi-bin?


----------



## whatsmydingo

I could be wrong, but I wouldn't think that the script would return perl runtime errors if it were outside the script zone. But I could be wrong.


----------



## Christopher

Ah, thats true. But hey nothing else seems to be workign


----------



## whatsmydingo

well my offer still stands - if you want I can take a look at it. Sometimes it's easier to see what's wrong if I can actually see it


----------



## ian

> Thanks guys, as far as I know all of that was done right so I've given up with that script  I hate CGI scripts.


Is it a well known script? I wouldnt give up, as a very last resort, I would try deleting everything and start all over again.


----------



## Suzanne

Thanks dingo I'll take you up on that offer if I decide to use it.  I'm trying out a free one now (I paid $70 for the non working one grrr) and it seems to be ok but I might change my mind again once I've tested it properly.

The one I didn't manage to get working was a link indexing script (the sql one) from www.mrcgiguy.com it looks good but the installation just has me totally discouraged from using it  So I'm trying out Linker from http://enproject.codelib.co.kr/ which is php and installing was a breeze lol


----------



## Christopher

If you payed for the script, didn't it come with support?


----------



## ian

I like software which has a support forum.


----------



## Christopher

lol Sorry, that comment just seemed random to me... Heheheh.

But I agree


----------



## whatsmydingo

Support forums are nice, but the for software that I have that has a support forum, the people in it always seem to know that there's a problem, but no one really seems to know how to fix it. Then after a while of people saying there's a problem, or the programmers saying they recognize there's a problem, the moderators lock the forum =Þ


----------



## zkiller

if you paid 70 bucks for the script, it had better work!!!!


----------

