Fixing 500 Internal Server Errors
Ce contenu n’est pas encore disponible dans votre langue.
500 Internal Server Error means something went wrong on the server while building the page, but the server can’t say what. The cause is almost always in your website’s files, and the error logs tell you which.
1. Read the error log
Section titled “1. Read the error log”- cPanel → Metrics → Errors shows the latest web server errors with the reason, such as a bad
.htaccessline or wrong permissions. - The
error_logfile in your website’s folder shows PHP errors. See Finding PHP error logs.
The newest entries at the bottom usually name the exact file and problem.
2. Check .htaccess
Section titled “2. Check .htaccess”A mistake in .htaccess is the most common cause.
- In cPanel’s File Manager, click Settings and tick Show Hidden Files.
- Rename
.htaccessin your website’s folder to.htaccess-old. - Reload your website.
If it works, the problem is in that file. Look for lines you added recently, especially php_value, php_flag, AddHandler or Options lines, and remove them. For WordPress, create a fresh file by going to Settings → Permalinks and clicking Save Changes.
3. Check for PHP errors
Section titled “3. Check for PHP errors”If the error log shows a PHP Fatal error:
- A plugin or theme caused it. In WordPress, rename the folder
wp-content/pluginstoplugins-offto turn off all plugins, then reload. If the site works, rename it back and turn plugins on one by one in the dashboard to find the faulty one. - You changed PHP version. Switch back in cPanel under Select PHP Version. See Resolving common PHP upgrade issues.
- The script ran out of memory. See PHP memory limit vs your plan’s RAM.
For what PHP error messages mean, see Common PHP errors.
4. Check file permissions
Section titled “4. Check file permissions”Folders must be 755 and files 644. Files or folders with 777 permissions, or PHP files that anyone can write to, are blocked for security. Fix them in File Manager with Change Permissions.
5. Restore a working copy
Section titled “5. Restore a working copy”If you can’t find the cause, restore your website files from yesterday’s backup. See Restoring files, email and databases using JetBackup.
Still seeing 500?
Section titled “Still seeing 500?”Open a support ticket with the page address and the time of the error. We’ll check the server logs for you.
Related articles
Section titled “Related articles”Cette page vous a-t-elle aidé ?
Merci pour votre retour.