500 Internal Server error-why?



I’m trying to use this cgi guestbook script:


I’ve set my permissions correctly, I have the 1st line of the script pointed to the right perl path…and when I run this command:

perl guestbook.cgi

from a command line it works just fine, creating the subdirectories as it should. Yet when I try to open “guestbook.cgi” in a web browser, I get a 500 Internal server error! Why is this happening?? perl -c revealed no syntax errors, and the script parses correctly if you run it from a command line, so why shouldn’t it work?

All my error log returns is “premature end of script” If anyone can tell me what’s happening and how to fix it, I’d be eternally grateful.


Try changing the permissions on the directory to 755. It appears scripts won’t run if you set the permissions on the directories they are in to anything else.


0751, 0701 or 0711 should work too (for the directory; the script will have to be 0755)… basically it (ie the directory) shouldn’t be group writable and it has to be executable by all. 0755 is what we recommend