PDA

View Full Version : help a beginner :(


ath0
09-20-2002, 02:04 AM
Hi, i'm at a loss for words, i dont know what the problem is, I'm learning perl and i copied this script exactly how it shows from this page (http://www.pageresource.com/cgirec/ptut14_1.htm) and i chmod'd it to 755 and when i goto run it i get Error 500.

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
...etc..

What could be wrong? Older version of Perl?

Thanks

kmj
09-20-2002, 10:24 AM
Don't worry; we'll get through this. :)

Okay, first, where are you trying to run this? On a server of your own? Where is the file, directly in cgi-bin? (Generally, they have to be in that or a subfolder.) What is the extension, '.pl'? Some servers won't except that, and only want '.cgi'.... I don't know much except from my limited experience, so you might even try '.pl' if you're using '.cgi'.

You say you "go to run it". I assume you mean, you load the page in a webbrowser, right?

kmj
09-20-2002, 10:27 AM
oh, another thing.. do you have a file "wrestledata.cgi" in the same directory? If not, the program will abort (where it says die ("Could not open file!");); since the program aborts before printing out the mime-type, you're guaranteed to get a 500/Internal Error if you don't have that datafile.


Finally, make sure you copied the file exactly, no typos (!), otherwise, it'll get an error running the script and p00f! internal error.

:)

btw, you can run cgi files at the command line to test them, by simply running perl filename.cgi... this will show you if you have a compiler error. If the program expects input, you have to type it.. otherwise, I think you type ctrl+d to tell it you're done giving input (or there is no input).

ath0
09-21-2002, 11:26 PM
Thanks i got it, i dunno what i did but i got it working :)

jm0285
09-29-2003, 11:58 AM
ath0,

I did the same lesson, got the same message. I found a blank space on the end of my line that threw it off.