The WordPress 500 Internal Server Error is one of the most common and frustrating errors. It has no single cause — this guide covers every possible fix systematically.
Step 1 — Check Error Logs First
# Nginx error log
sudo tail -50 /var/log/nginx/error.log
# PHP-FPM log
sudo tail -50 /var/log/php8.2-fpm.log
# WordPress debug log
sudo tail -50 /var/www/html/wp-content/debug.log
Step 2 — Enable WordPress Debug Mode
# Add to wp-config.php
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
Step 3 — Deactivate All Plugins
# Via WP-CLI (fastest)
wp plugin deactivate --all
# Or rename plugins folder via SSH
mv /var/www/html/wp-content/plugins /var/www/html/wp-content/plugins-disabled
# Test site — if fixed, reactivate plugins one by one
mv /var/www/html/wp-content/plugins-disabled /var/www/html/wp-content/plugins
wp plugin activate plugin-name
Step 4 — Fix PHP Memory Limit
# wp-config.php
define('WP_MEMORY_LIMIT', '256M');
# Or php.ini
memory_limit = 256M
# Restart PHP-FPM
sudo systemctl restart php8.2-fpm
Step 5 — Reset .htaccess
# Rename existing .htaccess
mv /var/www/html/.htaccess /var/www/html/.htaccess.bak
# Create fresh WordPress .htaccess
cat > /var/www/html/.htaccess << 'EOF'
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
EOF
Step 6 — Fix File Permissions
find /var/www/html -type f -exec chmod 644 {} \;
find /var/www/html -type d -exec chmod 755 {} \;
chown -R www-data:www-data /var/www/html
Step 7 — Revert WordPress Core
# Reinstall WordPress core files (doesn't touch content)
wp core download --force
Conclusion
WordPress 500 errors are always fixable with systematic diagnosis. Our team provides emergency WordPress recovery with 15-minute response time.
Comments