// Blog

How to Fix WordPress 500 Internal Server Error on Linux VPS — CLIQHOST

October 18, 2026 · by Alex M.

How to Fix WordPress 500 Internal Server Error on Linux VPS — CLIQHOST

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.


What Is the 500 Internal Server Error?

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:

  • a corrupted or misconfigured .htaccess file
  • an incompatible or broken WordPress plugin or theme
  • exceeded PHP limits (memory, execution time)
  • incorrect file or directory permissions
  • PHP-FPM or php.ini configuration errors
  • MySQL/MariaDB database corruption or service failure
  • conflicts at the web server level (Apache or Nginx)

If 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.


Step 1: Enable Debug Mode (WP_DEBUG)

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_DISPLAY on 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.


Step 2: Check Web Server Error Logs

Whether you run Apache or Nginx, server logs are the primary source of information.

On Apache:

tail -n 50 /var/log/apache2/error.log
# or for a specific site:
tail -n 50 /var/log/apache2/example.com-error.log

On Nginx:

tail -n 50 /var/log/nginx/error.log
# or:
tail -n 50 /var/log/nginx/example.com.error.log

PHP-FPM Logs:

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.


Step 3: Reset the .htaccess File (Apache Only)

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:

  1. Go to Settings → Permalinks in the WordPress admin panel
  2. Click Save Changes (without changing anything)

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

Step 4: Deactivate All Plugins

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.


Step 5: Switch to a Default WordPress Theme

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.


Step 6: Check and Increase PHP Limits

Exceeding PHP memory limits is a frequent cause, especially on sites with many plugins or large images.

Check the current limit:

php -i | grep memory_limit

Increase the limit in 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.


Step 7: Fix File and Directory Permissions

Incorrect permissions can cause fatal errors. The recommended standard for WordPress is:

  • Directories: 755
  • Files: 644
  • wp-config.php: 600

Fix 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).


Step 8: Check the MySQL/MariaDB Database

A corrupted database or a stopped MySQL service can generate a 500 error.

Check the service status:

systemctl status mysql
# or:
systemctl status mariadb

If the service is stopped:

systemctl start mysql

Repair WordPress tables:

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.

Or use WP-CLI:

wp db repair --path=/var/www/html
wp db check --path=/var/www/html

Step 9: Verify PHP-FPM Configuration and Socket

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

Step 10: Check Your SSL Certificate

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.


Quick Checklist — WordPress 500 Error

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

Prevention: How to Avoid 500 Errors in the Future

  1. Take regular backups — before any plugin, theme, or WordPress core update
  2. Test updates on a staging environment — never directly on production
  3. Monitor your logs — set up automated alerts for errors
  4. Keep PHP updated — PHP 8.1+ is significantly more stable and faster
  5. Choose quality hosting — insufficient resources are the #1 cause of 500 errors on high-traffic sites

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.


Conclusion

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.

SHARE
// what clients say

What Our Clients Say

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."

AM
Andrei M.
eCommerce owner · Chișinău
★★★★★

"Migrated 12 client sites to CLIQHOST. Free migration, zero downtime, and the cPanel setup is exactly what my team needed. Highly recommend."

EV
Elena V.
Web agency · Bălți
★★★★★

"Our NVMe VPS handles traffic spikes without a sweat. Full root, local datacenter, and billing in MDL — everything we wanted from a provider."

DC
Dmitri C.
SaaS founder · Chișinău