April 3, 2010

Getting a 500 Internal Server Error when Creating a New File

I was having a problem trying to create new files inside my web server. Every file I created would display a 500 Internal Server Error. I thought it was a problem with my web hosting company. It turns out that it was an issue with my default file permission setting. Using Aptana, it would create a file with default permission of 666, which can cause php to not be able to parse the file. This is what causes the 500 Internal Server Error.

To fix this, simply change the file permission to 644, which is also (rw- r– r–). Now all your files will display normally.

Notes

This is how you change the default file permissions under Aptana Studio.
Window->Preferences->Aptana->Permission

Also, Aptana has the default directory permission set to 777 (rwx rwx rwx). It would be safer if you changed the default permission for directories to 755 (rwx r-x r-x).

Leave a comment