500 Internal Server Error

liunx

Guest
~Ola,<br /><br />Loaded a sample perl program: <a href="http://sunsethosting.com/cgi-bin/hello.pl" target="_blank">http://sunsethosting.com/cgi-bin/hello.pl</a> containing the following lines of highly optimized code:<br /><br />#!/usr/bin/perl<br />print "Hello, world!\n";<br /><br />chmod'd to 755<br /><br />Getting 500 Internal Server Error.<br /><br />Uploaded in binary & ascii, deleted white space at end of lines....<br /><br /><br />Suggestions?<br /><br /><br /><br />Mel<!--content-->
Hmm.. could you give us more information about this perl program your trying to run?<!--content-->
<!--QuoteBegin-cerealkeeler+Jul 26 2003, 07:22 PM--><div class='quotetop'>QUOTE(cerealkeeler @ Jul 26 2003, 07:22 PM)</div><div class='quotemain'><!--QuoteEBegin-->Hmm.. could you give us more information about this perl program your trying to run?<!--QuoteEnd--></div><!--QuoteEEnd--><br />That's it man... 2 lines:<br /><br /><br />#!/usr/bin/perl<br />print "Hello, world!\n";<!--content-->
Someone else had this problem too:<br /><a href="http://www.totalchoicehosting.com/forums/index.php?showtopic=3036&hl=perl" target="_blank">http://www.totalchoicehosting.com/forums/i...ic=3036&hl=perl</a><br /><br />Basically, add the following code after the #!/usr/bin/perl line:<br /><br />print "Content-type: text/html\n\n";<br /><br />It should work, now <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><br /><br /><br />EDIT: Ignore this for a while, I thought this was the solution for the problem but it doesn't seem to be - I just read the rest of the thread I linked to.<br />I'll update this when I have some more info.<!--content-->
<!--QuoteBegin-borfast+Jul 26 2003, 08:06 PM--><div class='quotetop'>QUOTE(borfast @ Jul 26 2003, 08:06 PM)</div><div class='quotemain'><!--QuoteEBegin-->It should work, now <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><!--QuoteEnd--></div><!--QuoteEEnd--><br />yup yup... she works now..<br /><br />Now I gotta figure out 'why'... <br /><br />thank you sir.<br /><br /><br /> Thumbs Up<br /><br /><br /><!--QuoteBegin-borfast+Jul 26 2003, 08:07 PM--><div class='quotetop'>QUOTE(borfast @ Jul 26 2003, 08:07 PM)</div><div class='quotemain'><!--QuoteEBegin-->EDIT: Ignore this for a while, I thought this was the solution for the problema but it doesn't seem to be - I just read the rest of the thread I linked to.<!--QuoteEnd--></div><!--QuoteEEnd--> Actually, it did work for me. Thanks again.<!--content-->
Well, glad it works. I thought it wouldn't work because I read someone saying on the other thread that it didn't work for them but on the other hand, when I read that thread, I recall trying that and it fixed the problem, so I was a little confused <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/tongue.gif" style="vertical-align:middle" emoid=":p" border="0" alt="tongue.gif" /><br /><br />As to the 'why' part, I can't tell you for sure, since I know almost nothing about PERL but I'd guess that the PERL interpreter doesn't output the HTTP MIME type by default and Apache doesn't put it in either, so in order for the script to work correctly, the MIME type has to be output.<br /><br />Anyway, good scripting <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><!--content-->
The original script will work fine from the command line or shell but you need to define the output as html text for it to work in a browser.<!--content-->
Much mahalo! Rock Sign<!--content-->
 
Top