| | |
500 Internal Server Error - with a twist
Please support our Perl advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Aug 2005
Posts: 1
Reputation:
Solved Threads: 0
I kept getting 500 Internal Server Errors when trying to set up one of my Perl scripts, so I decided to test a simple "Hello World!" script. It produced the same error:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
I've uploaded the file in ASCII, I've set the permissions to 755, I've connected to the server with ssh and verified the path to Perl. None of that fixed the problem. The strangest part is when I try to run the script while I've connected with ssh is that it works:
$ ./test.cgi
Content-type:text/html
Hello world! This CGI / PERL script is working properly!
$
Does anyone have any ideas why I can't get even the "Hello World!" script to run on my web site? Thanks for your help.
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
I've uploaded the file in ASCII, I've set the permissions to 755, I've connected to the server with ssh and verified the path to Perl. None of that fixed the problem. The strangest part is when I try to run the script while I've connected with ssh is that it works:
$ ./test.cgi
Content-type:text/html
Hello world! This CGI / PERL script is working properly!
$
Does anyone have any ideas why I can't get even the "Hello World!" script to run on my web site? Thanks for your help.
my webserver's well wierd, i have a cpanel frontend i can login to plus various ftp clients on my pc; if i upload a perl script and set the permissions correct i get a 500 error, if i overwrite a working perl script (using ActiveState Komodo) i get a 500 error (of course i check the permissions afterwards!) if i upload a file then change the permissions using cpanel, guess what! i get a 500 error.
infact, the only way i can get a perl script up, is to use my cpanel to create a new perl file, then set the permissions, then overwrite the contents of the file; but only in cpanel.
what's with that?! :eek:
infact, the only way i can get a perl script up, is to use my cpanel to create a new perl file, then set the permissions, then overwrite the contents of the file; but only in cpanel.
what's with that?! :eek:
Plato forgot the nullahedron..
•
•
•
•
make sure you are uploading the file in ASCII (text) format and not binary format.
Komodo's remote save should certainly be ASCII though!
Loading an ftp client other than Windows XP is as much of an inconvenience as opening up cpanel..
It seems arbitrary sometimes; I've had success with XP FTP sometimes, and Komodo remote save sometimes : but the only way at the moment that I can guarantee 500 errors arent a result of my own mistakes is to create the files in cpanel and overwrite the contents...
It took me hours to figure out that that would work. Certainly seems strange!
Last edited by MattEvans; Sep 1st, 2006 at 1:41 am.
Plato forgot the nullahedron..
•
•
Join Date: Jul 2004
Posts: 494
Reputation:
Solved Threads: 21
With XP's FTP client, you have a choice. Use "binary" or "ascii" to set the mode. (See also:http://www.uncreativelabs.net/howtos/ftp.htm (Yes this is a plug.))
Also, are you trying to run your "Hello World" script on the web server side in the cgi-bin directory? Once I put the file in cgi-bin and set permissions, it ran fine.
http://puckdroppers.us/cgi-bin/test.pl
--
For the record I'm new to Perl, about furthest I've gotten is declaring my intent to learn it and giving a few reasons why.
Also, are you trying to run your "Hello World" script on the web server side in the cgi-bin directory? Once I put the file in cgi-bin and set permissions, it ran fine.
http://puckdroppers.us/cgi-bin/test.pl
--
For the record I'm new to Perl, about furthest I've gotten is declaring my intent to learn it and giving a few reasons why.
www.uncreativelabs.net
Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
•
•
•
•
This wouldn't be a problem with the script since it runs fine from the command but a misconfiguration of apache or whatever webserver you are using.
I missed your post somehow so I realize this is a late reply. The problem could very well be the script. If run as a CGI it needs to print an http header before trying to print anything else. This is not a problem from the command line and will work, but will error out with a 500 ISE if initiated as a CGI script from a browser.
Last edited by KevinADC; Sep 8th, 2006 at 3:35 am.
•
•
Join Date: Sep 2006
Posts: 30
Reputation:
Solved Threads: 1
After you have created a working copy with cpanel and overwritten it with your code, do
Then rename that file.
Then upload so you get the 500 error and do the cat again.
Then diff them.
And post all output here.
I think the upload is messing with your output. I'm betting on the DOS EOL is corrupting the
Perl Syntax (Toggle Plain Text)
cat -v test.pl
Perl Syntax (Toggle Plain Text)
mv test.pl goodtest.pl
Perl Syntax (Toggle Plain Text)
cat -v test.pl
Perl Syntax (Toggle Plain Text)
diff test.pl goodtest.pl
I think the upload is messing with your output. I'm betting on the DOS EOL is corrupting the
"Content-type: text/html" string into "Content-type: text/html^M" ![]() |
Similar Threads
- Internal Server Error (Perl)
- 500 internal server error (*nix Software)
- php_value inclue path says internal server 500 error (Linux Servers and Apache)
- why getting "302 found" and "500 Internal Server" errors? (PHP)
- Http 500 -internal Server Error (Site Layout and Usability)
- Getting error 500 Internal Service Error..Meaning? (Web Browsers)
Other Threads in the Perl Forum
- Previous Thread: Lightning Talk Topic Ideas
- Next Thread: perl mechanize $mech->save_content($filename) problem
| Thread Tools | Search this Thread |






