Portal Home > Knowledgebase > General > Error Handling > What can cause 500 Errors?


What can cause 500 Errors?




What can cause 500 errors? 

A "500 Error" is a "catch-all" error generated by the web server. Basically, something has gone wrong, but the server can not be more specific about the error condition in its response to the client. Because this is such a generic error message it can be frustrating to track the cause down. The more common reasons and fixes are below.

A common reason for 500 errors is an issue with file/folder permissions. If you're on a shared server and this happens to you; go to the cPanel file manager and make sure every file is at 644 permissions, and every folder is at 755 permissions. There are a handful of scripts that actually need more permissions, but those should be labeled clearly in your CMS manual. To see the permissions of a file in the cPanel file manager, just look for the number on the right of the file. Setting your file permissions to 777 will likely cause an error and can cause security problems.

Sometimes "WordPress plugins" and/or "themes" can be the cause of 500 errors. If you installed one of these recently and are now getting a 500 error on every page. No need to worry.
Simply navigate to the public_html/wp-content/plugins folder and rename the plugin that you just installed OR navigate to the public_html/wp-content/themes folder and rename the folder
that you just installed.

In addition to the 500 Error notified back to the client, the cPanel usually generates some kind of internal error log which gives more details of what went wrong. This can be found in the 'Error Logs' section of Cpanel. If you're suddenly getting a 500 Error on your site and you don't remember making any changes recently, the first thing to check is your .htaccess file. This can be found in the public_html/ directory after checking the box 'Show Hidden Files (dotfiles).' in the cPanel File Manager. It will be visible no matter what in a separate FTP client. To test if the issue is in the .htaccess file, simply rename the file to .htaccess1 and SAVE it. Once that's done, clear your browser's cache and refresh the page.

If this works, it could have been a theme or plugin that made changes to the file.

Another reason for a 500 Error is an issue with PHP code on the page. Check your code and make sure everything is working correctly. You can turn on PHP error reporting for even more information if this is the cause for the 500 Error.

To turn PHP error reporting on, login into Cpanel, open File Manager in the public_html directory and create a file called php.ini. Now edit this file and paste the following then save:

display_error = off
log_errors = On
error_log = "error.log"

If you initiate external connections in your PHP code, like pulling in an RSS feed, be sure to code in a timeout handler. If the PHP script is allowed to timeout without handling gracefully this can cause a 500 error.

Check your php application and ensure the memory limit is sufficient. PHP will throw a fatal error if the memory limit (memory_limit in php.ini) is set too low.

If you are using perl (.pl) or cgi (.cgi) scripts ensure you are using a text editor that will save the file in the ASCII text format. Some editors will cause problems by saving the file in a format that will cause the 500 error. For cgi scripts in the cgi-bin directory ensure both files and directories have 755 permissions. For perl scripts ensure the appropriate modules are installed.

  
Need Additional Help? Go to "Live Chat" on the Hostwinds web site if you require further assistance.


Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read