October 18, 2026 · by Alex M.
The 500 Internal Server Error is one of the most common and frustrating problems WordPress site administrators face. A white screen, a blank page, or a generic error message — all are symptoms of this type of issue. The good news is that, in the vast majority of cases, the cause can be identified and resolved without losing data or reinstalling WordPress from scratch.
In this comprehensive guide, you'll learn how to diagnose and fix the 500 error in WordPress on a Linux VPS, step by step, with concrete commands and clear explanations.
HTTP status code 500 means the server encountered an unexpected condition that prevented it from fulfilling the request. Unlike a 404 error (page not found), a 500 error occurs on the server side, not the client side. It can be caused by:
.htaccess fileIf you have a NVMe VPS or SSD VPS with root access, you have the advantage of being able to inspect server logs directly — a critical step in troubleshooting.
The first thing to do is enable WordPress debugging to see the exact error message.
Connect to your VPS via SSH:
ssh root@YOUR_SERVER_IP
Open wp-config.php:
nano /var/www/html/wp-config.php
Find existing WP_DEBUG lines and replace them (or add them if missing) with:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors', 0);
Warning: Do not enable
WP_DEBUG_DISPLAYon a live production site — PHP errors could be visible to your visitors.
After saving, try to reproduce the error, then check the log file:
cat /var/www/html/wp-content/debug.log
This is the first diagnostic step and will often give you clear clues about what went wrong.
Whether you run Apache or Nginx, server logs are the primary source of information.
tail -n 50 /var/log/apache2/error.log
# or for a specific site:
tail -n 50 /var/log/apache2/example.com-error.log
tail -n 50 /var/log/nginx/error.log
# or:
tail -n 50 /var/log/nginx/example.com.error.log
tail -n 50 /var/log/php8.1-fpm.log
Look for messages like: PHP Fatal error, Maximum execution time, Allowed memory size, Permission denied, or No such file or directory. Each one points to a different fix.
If you need help interpreting logs or configuring your server, the CLIQHOST server management service can take over the entire technical management for you.
A corrupted .htaccess file is one of the most common causes of 500 errors on Apache. To check, temporarily rename it:
cd /var/www/html
mv .htaccess .htaccess_backup
Access the site in your browser. If it works, the .htaccess file was the culprit. Regenerate it from WordPress:
WordPress will automatically rewrite .htaccess with the correct rules.
If you want to create it manually, the standard WordPress .htaccess content is:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Incompatible or corrupted plugins are the second most common cause. If you can't access the WordPress admin panel, deactivate them via the command line:
cd /var/www/html/wp-content
mv plugins plugins_backup
mkdir plugins
Access the site again. If it works, restore and reactivate plugins one by one to find the culprit:
rm -rf plugins
mv plugins_backup plugins
Then activate each plugin through the WordPress dashboard and test after each one.
If you're on a cPanel shared hosting plan, you can deactivate plugins through the File Manager in cPanel without needing SSH.
The active theme can sometimes cause a 500 error, especially after an update. Switch themes via SSH:
cd /var/www/html/wp-content/themes
mv my-theme my-theme_backup
WordPress will automatically fall back to the default theme (e.g., twentytwentyfour). If no default theme is present:
wp theme install twentytwentyfour --activate --path=/var/www/html
This command requires WP-CLI installed on your server.
Exceeding PHP memory limits is a frequent cause, especially on sites with many plugins or large images.
php -i | grep memory_limit
php.ini:nano /etc/php/8.1/fpm/php.ini
Modify or add:
memory_limit = 512M
max_execution_time = 300
max_input_time = 300
post_max_size = 64M
upload_max_filesize = 64M
Restart PHP-FPM:
systemctl restart php8.1-fpm
Alternatively, add to wp-config.php:
define('WP_MEMORY_LIMIT', '512M');
Or in .htaccess (Apache only):
php_value memory_limit 512M
If your VPS resources are insufficient for a high-traffic WordPress site, it may be time to upgrade to a NVMe VPS with more RAM and superior performance.
Incorrect permissions can cause fatal errors. The recommended standard for WordPress is:
755644600Fix permissions with:
find /var/www/html -type d -exec chmod 755 {} \;
find /var/www/html -type f -exec chmod 644 {} \;
chmod 600 /var/www/html/wp-config.php
Check and fix file ownership:
ls -la /var/www/html/
chown -R www-data:www-data /var/www/html/
All files should belong to the web server user (www-data on Ubuntu/Debian, apache or nginx on CentOS).
A corrupted database or a stopped MySQL service can generate a 500 error.
systemctl status mysql
# or:
systemctl status mariadb
If the service is stopped:
systemctl start mysql
Add to wp-config.php:
define('WP_ALLOW_REPAIR', true);
Navigate to: https://example.com/wp-admin/maint/repair.php
After the repair, make sure to remove the added line from wp-config.php.
wp db repair --path=/var/www/html
wp db check --path=/var/www/html
With an Nginx + PHP-FPM setup, a misconfigured socket can cause 500 or 502 errors.
Check that the PHP-FPM socket exists:
ls -la /run/php/php8.1-fpm.sock
Check the pool configuration:
nano /etc/php/8.1/fpm/pool.d/www.conf
Make sure the listen directive in your Nginx block matches the socket:
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
Restart both services:
systemctl restart php8.1-fpm
systemctl restart nginx
In some configurations, an expired or misconfigured SSL certificate can generate 500 errors, especially when WordPress has its URL set to https:// but the certificate is no longer valid.
Check the expiration date:
openssl x509 -enddate -noout -in /etc/letsencrypt/live/example.com/cert.pem
For managed, professional SSL certificates, check out SSL certificates from CLIQHOST.
| Cause | Quick Fix |
|---|---|
Corrupted .htaccess |
Rename + regenerate via Permalinks |
| Incompatible plugin | Disable /plugins folder |
| Broken theme | Rename theme folder |
| PHP memory limit exceeded | Increase memory_limit in php.ini |
| Wrong file permissions | chmod 755/644 + chown www-data |
| Corrupted database | Repair via wp db repair |
| PHP-FPM stopped | systemctl restart php8.1-fpm |
| Expired SSL certificate | Renew certificate |
For a WordPress-optimised hosting plan with pre-tuned PHP settings and automatic backups, CLIQHOST has you covered. You can also explore managed dedicated server options for maximum performance.
For more server optimisation and security tips, visit the CLIQHOST blog.
The 500 Internal Server Error in WordPress can seem intimidating at first glance, but with a methodical troubleshooting process — enabling WP_DEBUG, inspecting logs, testing plugins, checking permissions and PHP limits — you'll be able to resolve the issue in most cases without external help.
If you'd rather leave server management to the professionals, CLIQHOST offers complete server management services and NVMe VPS plans optimised for WordPress, with 24/7 technical support. Contact us and we'll prepare a solution tailored to your needs.
Real reviews from customers who trust CLIQHOST for performance, reliability and expert technical support.
"We moved our online shop from a foreign host and the difference is night and day — pages load instantly and support replies in minutes, in Romanian."
"Migrated 12 client sites to CLIQHOST. Free migration, zero downtime, and the cPanel setup is exactly what my team needed. Highly recommend."
"Our NVMe VPS handles traffic spikes without a sweat. Full root, local datacenter, and billing in MDL — everything we wanted from a provider."