08 Sep 2010
Support Center
»
Knowledgebase
»
I do not see anything wrong with my script, but when I run it I get a 500 Internal Server error. Why is this?
I do not see anything wrong with my script, but when I run it I get a 500 Internal Server error. Why is this?
Solution
The problem you are getting is the result of many possible errors in your script, but the best advice that can be given is to generate the error, then look in your logs directory. When in your logs directory, view your error_log file to see what error has occurred. This can usually help a lot.
Something that many users are not aware of (and this is especially important when making Perl scripts), is that Microsoft systems don't write text in the same way as Unix systems do. When you save a document in Microsoft text format (ie in Notepad), every line ends with CR/LF (which means Carriage Return - go to the start of the line, and then Line Feed - which goes down one line). Unix simply needs a CR, not CR/LF. LF is represented in Unix as the character ^M (as LF is a non-printable character).
Looking at perl files in a Unix editor such as vim indicates ^M's if they exist. To make sure that your scripts don't fall to the wrath of the ^M's, which breaks them, try running a DOS2UNIX program on them which strips the ^M's before an upload.
You can download DOS2UNIX for free from
www.bastet.com/
Article Details
Article ID:
3
Created On:
31 Jul 2009 09:20 AM
This answer was helpful
This answer was not helpful
User Comments
Add a Comment
Sharing is good. If you have a comment about this entry, please feel free to share. The comments might be reviewed by our staff, and may require approval before being posted. Questions posted will not be answered. Please submit a Ticket for support requests.
Fullname:
Email: (Optional)
Comments:
Login
[Lost Password]
Email:
Password:
Remember Me:
Search
-- Entire Support Site --
Knowledgebase
Downloads
Troubleshooter
Article Options
Add Comment
Print Article
PDF Version
Email Article
Add to Favorites
Home
|
Register
|
Submit a Ticket
|
Knowledgebase
|
Troubleshooter
|
News
|
Downloads
Language:
English (U.K.)
Support System By Digital Dreamspace SupportSuite v3.11.00