![]() |
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? |
Could be a number of things... :(
|
watch error.log for the actual error.
|
:thumbsup
|
Quote:
:321GFY |
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 |
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. |
check the suexec log
|
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