Question
internal server error 500 php
I am occasionally getting an internal server error 500 on
some pages in IE and Dreamweaver. I have made a connection to a
MySQL DB and test the connection and data from it. But, I have just
gone to create a new recordset and all of a sudden, there were no
tables in the DB.
I tested the page and got the 500 error and something about restricted access!!
So, I googled it and I found this on the net (Indian University) http://webmaster.iu.edu/PHPlanguage/index.shtml
---
When the file/directory permissions are set correctly, and you are still getting a 500 error, it is likely due to line compatibility between the program used to create/upload the file and the Linux server. To correct this, login to the account on Webserve via an SSH client that provides a command line interface and do the following:
Move to the directory where your php file is using the 'cd' command (e.g., cd www).
Open the file using an editor such as nano and save it by typing Ctrl + o
This simple steps may solve your problem because it converts Windows CR/LF (carriage return/line feed) to Unix LF (line feed) or Mac CR to Unix LF.
To prevent this problem, you need to change settings/preferences in the program you are using to develop php files. To set preferences in Dreamweaver, go to Edit => Preferences. Select Code Format or HTML Format (depending on the versions). Change Line Breaks to LF (Unix).
---
I am using PHP on IIS rather than Apache because I usually develop in ASP. Why? ASP is stable; easy to set up; works straight away; doesn't make me cry every five minutes; doesn't make me have fits of rage because it doesn't want to work and so on...
Could this line break thing be one of the reasons for the erratic behaviour of PHP. To get rid of the problem I have to restart and it goes away.
Mat
I tested the page and got the 500 error and something about restricted access!!
So, I googled it and I found this on the net (Indian University) http://webmaster.iu.edu/PHPlanguage/index.shtml
---
When the file/directory permissions are set correctly, and you are still getting a 500 error, it is likely due to line compatibility between the program used to create/upload the file and the Linux server. To correct this, login to the account on Webserve via an SSH client that provides a command line interface and do the following:
Move to the directory where your php file is using the 'cd' command (e.g., cd www).
Open the file using an editor such as nano and save it by typing Ctrl + o
This simple steps may solve your problem because it converts Windows CR/LF (carriage return/line feed) to Unix LF (line feed) or Mac CR to Unix LF.
To prevent this problem, you need to change settings/preferences in the program you are using to develop php files. To set preferences in Dreamweaver, go to Edit => Preferences. Select Code Format or HTML Format (depending on the versions). Change Line Breaks to LF (Unix).
---
I am using PHP on IIS rather than Apache because I usually develop in ASP. Why? ASP is stable; easy to set up; works straight away; doesn't make me cry every five minutes; doesn't make me have fits of rage because it doesn't want to work and so on...
Could this line break thing be one of the reasons for the erratic behaviour of PHP. To get rid of the problem I have to restart and it goes away.
Mat
