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.
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_login the same directory as the script — open it in File Manager. - Your own server:
/var/log/nginx/error.logor/var/log/apache2/error.log(on AlmaLinux:/var/log/httpd/error_log). The PHP-FPM log is available withjournalctl -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 symptom | What to do | |||
|---|---|---|---|---|
PHP Fatal error | with a file name and line number | an 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 … exhausted | PHP is running out of memory — increase memory_limit in the PHP settings (in cPanel: MultiPHP INI Editor) | |||
Invalid command | or | .htaccess: … not allowed here | there is a faulty line in .htaccess — remove it, or temporarily rename the file: | The .htaccess file |
| the site broke after the PHP version was changed | go back to the version the site worked with: | PHP version for a site | ||
| an error in a CGI script | permissions 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.