WEB HOSTING SUPPORT NETWORK
     
 

Error 500 (Internal Server Error)

Here you can find the most common reasons for a 500 server rrror:

• Incorrect file/directory permissions

Almost always Error 500 is caused by insufficient permissions of a file or directory. On our servers you should make sure your files and directores have world-writable permissions, so using permissiosn 644, 664, 755 for files. You can use the same permissions as well as 775 for directories.

If you wish to have a script executed by your website visitors, it should have access permissions starting with 7 (-rwx) or with 5 (-r-x) like 0775 (-rwxrwxr-x), 0755 (-rwxr-xr-x), 0750 (-rwxr-x---), and 0700 (-rwx------). This will allow the script to get executed by your hosting account user and the Apache web server. If the file/directory is lacking these permissions, the script will return a 500 Internal Server Error. More details about permissions and what they actually mean are available in our File and folder permissions (CHMOD) article.

• Invalid or wrong code in .htaccess files

Invalid or wrong code in your .htaccess files can cause 500 server errors. If you are trying to modify PHP settings with php_flag directives, this may result in a Internal Server Error. PHP runs does not run as an Apache module on our servers, it runs as CGI or FPM, so you cannot use php_flag directives. You can make changes to your PHP configuration using the hosting Control Panel > PHP Settings section or by using a .user.ini and php.ini files. For more details, you can check our Changing PHP settings  article.

• Using Windows EOL (end-of-lines) characters

This problem may occur if you are using a text editor like Notepad or Wordpad. When you add a new line with these programs, they may add EOL characters for Microsoft Windows, which are different than the EOL characters for Linux that runs on our servers.

To resolve this problem, you can open view the files via the hosting Control Panel > File Manager section without modifying them and simply click on the "Save and Exit" button. The File Manager editor will remove the Windows EOL characters and replace them with UNIX EOL characters. Executing your script should no longer return Error 500.

We would recommend that you use alternative text editors that are free of charge instead of Notepad and Wordpad. Here are two examples:
- PSPad (www.pspad.com)
- Notepad++ (http://notepad-plus.sourceforge.net/bg/site.htm)

• Incorrect path to Perl, Ruby, or Python

If you use a Perl, Ruby, or Python скрипт, make sure you use the correct path to its binary. You can find the correct path on the server for the binaries you wish to use on your account in the hosting Control Panel > System Information.

File and folder permissions