Jump to content

Problem running perl program


USAF MARS

Recommended Posts

If this is the wrong forum to post this, I apologize.

 

OK, I've got to be doing something really stupid and probably extremely obvious to everyone else. Please point out my stupid error(s)...........

 

Going to http://usafmars.helio-host.org/cgi-bin/HelloWorld.pl

produces:

Internal Server Error

 

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

 

Please contact the server administrator, webmaster@usafmars.heliohost.org and inform them of the time the error occurred, and anything you might have done that may have caused the error.

 

More information about this error may be available in the server error log.

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.#!/usr/bin/perl

---------------------------------------------------------------------------------------

The error log has these entries:

[Fri Oct 31 12:32:43 2008] [error] [client 69.179.109.186] File does not exist: /home/usafmars/public_html/500.shtml

[Fri Oct 31 12:31:57 2008] [error] [client 69.179.109.186] File does not exist: /home/usafmars/public_html/404.shtml

---------------------------------------------------------------------------------------

Here is the Perl program -- pretty simple, but only used for testing. it's in the cgi-bin folder and has protection set to 755. cPanel reprts HelloWorld.pl as an Application/pl

 

#!/usr/bin/perl

#

# Program to do the obvious

#

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

print 'Hello world.'; # Print a message

Link to comment
Share on other sites

This is an extremely weird error. Although you did have the mistake of using "Context-type" instead of "Content-type", when I fixed that the 500 errors were still coming up. I copied the contents of a working Hello World into your file and it still didn't work. I did the opposite with your original text, and that worked fine. When I copy your original file, however, the new copied file won't work either.

 

Just create a new file with the same text and see if it works for you.

Link to comment
Share on other sites

This is an extremely weird error. Although you did have the mistake of using "Context-type" instead of "Content-type", when I fixed that the 500 errors were still coming up. I copied the contents of a working Hello World into your file and it still didn't work. I did the opposite with your original text, and that worked fine. When I copy your original file, however, the new copied file won't work either.

 

Just create a new file with the same text and see if it works for you.

 

Thinking that the file had become somehow corrupted during the FTP transfer, I created a new file HelloWorldTest.pl from cPanel which was essentially the same as HelloWorld.pl with the typo fixed. I initially forgot to set the permission from 644 and got the same errors. I set the permissions to 755 and it now works.

 

Your new file, HelloWorld2.pl still does not work for me either

 

I'll need to do a bit more experimentation, but it would seem that DreamWeaver's FTP may have corrupted the file. Is it possible that the file was sent in binary rather than text?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...