GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   server gurus please help! - Premature End of Script Headers (https://gfy.com/showthread.php?t=244254)

hanii 02-28-2004 03:06 AM

server gurus please help! - Premature End of Script Headers
 
apache 2.0.46 (rhel es 3.0)

I am trying to run a perl script on my server, but when I try to run it via a web browser I get "Internal Server Error." The server error log says "premature end of script headers." The permissions are 755 on the cgi-bin directory and the script. This is the script i'm trying to run:

#!/usr/bin/perl -w

print "Content-type: text/html\n\n";

print "Hello, world.\n";


This is the directive I have in my httpd.conf file:

Directory "/home/users/*/www/cgi-bin">
Options ExecCGI
/Directory>
(removed '<' for banned word)

Anyone know what the problem could be?

KDizzla 02-28-2004 03:20 AM

Could be a number of things... :(

darksoul 02-28-2004 03:48 AM

watch error.log for the actual error.

hoe_vender 02-28-2004 04:05 AM

:thumbsup

420 02-28-2004 04:10 AM

Quote:

Originally posted by hoe_vender
:thumbsup
good job man, I knew with just a few more smilie posts you would pass 500 tonight

:321GFY

devmug 02-28-2004 04:34 AM

might be control-m on the end of lines .. this sometimes produces premature blah errors .. try editing your source in a proper editor such as textpad and saving as file type unix or use vi on your server ... hope this helps.

Devmug
avsMatrix

Nathan 02-28-2004 04:46 AM

hi hanii

I do not have access to any rhel es 3.0 box to test this, but the problem very likely is because the script is not really executable.

Not sure if you have shell access, but if you have, then go and login to the server, go to the dir the script is at and run it manually.

eg: if the script is called helloworld.cgi then type: ./helloworld.cgi

See if that works. If that works, make sure the ending is .cgi and not .pl, since Options ExecCGI would only allow .cgi to execute as far as I remember.

If it does NOT work (which is very likely) then your path to perl will be wrong. It will say something like:
bash-2.0: /usr/bin/perl: No such file or directory

Easiest way to figure this out is typing:
whereis perl
on the prompt. This should give you the real location of perl on the server. It might also be perl5, ie:
whereis perl5

The error might also be a perl error. I do not see a perl error in the code you posted, but it might be a wrong upload like devmug suggested, meaning you have to upload the file in ASCII mode!


If you do NOT have shell access to the server, contact your host and ask them what the path to perl is, since that is the most likely error.

rounders 02-28-2004 04:48 AM

check the suexec log

RK 02-28-2004 05:01 AM

Are you using suexec?
The log is called suexec_log


All times are GMT -7. The time now is 12:22 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123