Website errors

How to fix a 500 Internal Server Error on your own website

A 500 error means the server hit a problem it could not describe to the browser. The real reason is almost always written in an error log, so start there, then check .htaccess, permissions, PHP memory and plugins.

Updated 3 min readApplies to: cPanelApplies to: Plesk

What a 500 error means

"500 Internal Server Error" is a general message. The web server or PHP failed while building your page and did not send a more specific reason to the browser. This article covers your own website on cPanel or Plesk hosting. If you see a 500 on someone else's site, only its owner can fix it.

Work through the steps in order; the first one usually tells you the answer. For a wider list of errors, see troubleshooting common hosting errors.

Before you start: Download a copy of any file before you edit it, so you can put it back.

Steps to fix it

  1. Read the error log. In cPanel open Metrics > Errors to see recent web server errors for your account. Also open File Manager and look for a file called error_log in public_html and in the folder of the page that fails. In Plesk, open your domain and choose Logs. Note the newest lines with a timestamp matching your visit.

  2. Test the .htaccess file. In File Manager, enable "Show Hidden Files", rename public_html/.htaccess to .htaccess-old, and reload the site. If the error goes away, a rule in that file is the cause. For WordPress, create a fresh file by going to Settings > Permalinks and clicking Save Changes, then re-add any custom rules one at a time.

  3. Check permissions. Files should normally be 644 and folders 755. In File Manager, select an item and choose Permissions. Avoid 777: on many shared servers PHP refuses to run files that everyone can write to and returns a 500 error instead.

  4. Raise the PHP memory limit if the log says Allowed memory size of ... bytes exhausted. In cPanel use Software > MultiPHP INI Editor (or the options tab of Select PHP Version, depending on what your server offers) and increase memory_limit, for example from 128M to 256M. For WordPress you can also add this line to wp-config.php above the "That's all, stop editing" comment:

    define( 'WP_MEMORY_LIMIT', '256M' );
    

    Your plan's limits still apply, so a much higher number may not take effect.

  5. Disable plugins. If you cannot reach the WordPress dashboard, rename wp-content/plugins to plugins-off in File Manager. If the site loads, rename it back and then rename individual plugin folders until you find the faulty one. Do the same with the active theme folder in wp-content/themes if plugins are not the cause.

  6. Compare the PHP version with what your site needs. A recent change of PHP version, or an old theme, can produce fatal errors. See how to change the PHP version in cPanel.

  7. Turn on WordPress debug logging temporarily if the logs above are empty:

    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );
    

    Errors are written to wp-content/debug.log. Remove these lines once you have the answer, because the log can expose details about your site.

How to confirm it worked

  • The page loads normally in a private browser window.
  • No new lines appear in Metrics > Errors or error_log when you reload the page.
  • Forms, checkout and the admin area also work, not only the home page.

If you see a 503 rather than a 500 after these steps, the cause is different; see fixing 503 Service Unavailable.

If it still fails

Open a support ticket and include:

  • The full URL that shows the error and when it started (date and time in IST)
  • The last 10 to 20 lines of the error log, copied as text
  • What changed just before: an update, a new plugin, a PHP version change, a file upload
  • The steps from this list you have already tried
  • Screenshots of the error page

Do not paste passwords, wp-config.php contents or database credentials into the ticket.

Frequently asked questions

Is a 500 error my fault or the host's?

Usually it comes from something on the site: a .htaccess rule, a plugin, a PHP error or wrong permissions. If every site on your account shows 500 at the same moment and you changed nothing, it may be server side, so open a ticket.

Where is the PHP error_log file on cPanel?

On many cPanel servers PHP writes a file named error_log in the same folder as the script that failed, often public_html or wp-admin. Your host's PHP settings decide the exact location.

Will fixing permissions with 777 solve it?

No. On many shared servers, files or folders writable by everyone are refused for security and can cause the 500 error themselves. Use 644 for files and 755 for folders.

Can a PHP version change cause a 500 error?

Yes. Old themes and plugins can fail on newer PHP versions. Check the error log for fatal errors, and switch back temporarily while you update the code.

Sources and further reading

Contact us