500 Internal Server Error means the website’s own code or configuration failed while building the page. The message is deliberately vague; the real reason is in the error log.
If you are visiting the site
There is nothing to fix on your side. Try again later, or tell the site owner which page failed and when.
If you run the site
1. Read the error log
This is the single most useful step.
sudo tail -n 50 /var/log/nginx/error.log
sudo tail -n 50 /var/log/apache2/error.log
On shared hosting, look for an “Errors” or “Logs” section in the control panel, or a file called error_log in your site folder. PHP fatal errors look like this:
PHP Fatal error: Uncaught Error: Call to undefined function ... in /var/www/.../plugin.php:42
The file path tells you which plugin, theme or file is at fault.
2. Undo the last change
A 500 that started right after an update, a new plugin or an edit is almost always that change. Roll it back first, investigate second.
3. On WordPress, isolate plugins and theme
Rename the plugins folder to switch every plugin off at once:
cd wp-content
mv plugins plugins-off
If the site loads, rename it back and switch plugins off one at a time to find the culprit. With WP-CLI, wp plugin deactivate --all does the same. Turning on WP_DEBUG_LOG in wp-config.php writes errors to wp-content/debug.log.
4. Check .htaccess on Apache
A typo in .htaccess causes an instant 500 on every page. Rename it to .htaccess-off to test; on WordPress, save Permalinks in the admin to write a fresh one.
5. Check permissions
Files should usually be 644 and folders 755, owned by the user PHP runs as. Scripts that are world-writable (777) are refused by many servers.
6. Check PHP limits
Errors such as Allowed memory size exhausted mean PHP’s memory_limit is too low for the page. Raise it in php.ini or the PHP-FPM pool, then restart PHP-FPM.
Related
- White screen of death, WordPress’s version of a hidden 500.
- 503 Service Unavailable.
Something out of date? Software changes. If a step no longer works, tell us and we will check it and update the page.



