Skip to content
RIPE NCC member · Local Internet RegistryCall us on 020 3318 3449sales@hosting-telecom.uk

Error 500 on a website

What 500 Internal Server Error means, where to find the error log on hosting and on your own server, and how to track down the cause: PHP, .htaccess, PHP version, memory, WordPress plugins.

Contents

500 Internal Server Error is a general server error: something went wrong while the page was being processed, and the server does not tell the visitor what. The answer is almost always in the error log.

If you are a visitor

There is nothing you can do — the fault is on the website’s side. Try again later or let the site’s owner know.

Where to find the log

  • Hosting: in cPanel, open Errors to see the site’s most recent errors. PHP errors are also written to a file called error_log in the same directory as the script — open it in File Manager.
  • Your own server: /var/log/nginx/error.log or /var/log/apache2/error.log (on AlmaLinux: /var/log/httpd/error_log). The PHP-FPM log is available with journalctl -u php8.4-fpm.

Load the page again and look at the log straight away — the line you need will be the last one.

Common causes

Log line or symptomWhat to do
PHP Fatal error with a file name and line numberan error in the code — most often after a plugin or theme update; go back to the previous version or disable the plugin
Allowed memory size … exhaustedPHP is running out of memory — increase memory_limit in the PHP settings (in cPanel: MultiPHP INI Editor)
Invalid command or .htaccess: … not allowed herethere is a faulty line in .htaccess — remove it, or temporarily rename the file: The .htaccess file
the site broke after the PHP version was changedgo back to the version the site worked with: PHP version for a site
an error in a CGI scriptpermissions and line endings: File permissions, CGI scripts

WordPress

If the site went down after a plugin was installed or updated, disable all the plugins at once by renaming the wp-content/plugins directory, for example to plugins.off. If the site works again, restore the name and turn the plugins on one at a time in the admin area.

You can turn on detailed WordPress logging in wp-config.php:

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

Errors will be written to wp-content/debug.log, and visitors will not see them. Once you have found the cause, turn debugging off.

On your own server

To check a PHP file for syntax errors, run php -l index.php. If PHP-FPM is not running, nginx returns a 502 rather than a 500 — see 502 Bad Gateway error. If the site has been hacked and the files contain someone else’s code, see Site hacked: what to do.

Didn’t find the answer? Ask our support team — we’ll help.

Choose which cookies we may use. You can change your mind at any time with the “Cookie settings” link at the bottom of every page.

Necessary

Always active

They keep the site secure and remember your cookie choice. They don’t identify you.

Google Analytics counts visits and shows which pages people find useful, so we can improve the site. Which cookies