500 Internal Server Error: Causes and Solutions
Last updated: 31 December 2025
500 internal server error: causes and solutions
A 500 Internal Server Error is one of the most frustrating errors you can encounter. Unlike a 404 error (where the page simply doesn't exist), a 500 error indicates a serious problem with the server itself. Your website is literally broken. In this article we explain what a 500 error is, what causes it, and how to fix it.
What is a 500 internal server error?
The 500 Internal Server Error is a general HTTP status code indicating something went wrong on the server side, but the server cannot be more specific about what exactly the problem is. It's essentially the server saying: "Something went wrong, but I don't know what or I can't explain it."
This error is different from client-side errors (like 404). The problem isn't with the user or the requested URL, but with the server hosting the website. The server cannot process the request due to an internal error.
Variants you might encounter:
- "500 Internal Server Error"
- "HTTP 500 - Internal Server Error"
- "500 Error"
- "HTTP Error 500"
- "Internal Server Error"
- "500. That's an error."
All variants mean the same: the server has a problem.
Common causes
A 500 error can be caused by many things. Here are the most common causes:
Errors in .htaccess file: This is one of the most common causes. A syntax error in your .htaccess file can crash the entire site. Even a missing space or bracket can be enough.
PHP memory limit exceeded: WordPress or other PHP applications may need more memory than allowed. If the script hits the memory limit, you get a 500 error.
PHP timeouts: If a script runs too long (for example a too large database query), the server can kill the process, resulting in a 500 error.
Corrupt WordPress core files: Damaged WordPress files can cause 500 errors, often after a failed update.
Plugin conflicts: An incompatible or buggy plugin can break your entire site. This is extremely common after plugin updates.
Theme problems: An error in your theme code (functions.php is often the culprit) can trigger a 500 error.
Database connection problems: If WordPress can't connect to the database (wrong credentials, database server down), this can give a 500 error.
File permissions: Wrong chmod permissions on crucial files or folders can confuse the server and cause a 500 error.
Server configuration problems: php.ini misconfigurations, Apache/Nginx configuration errors, or server software hanging.
Resource limits: Your hosting account has limits for CPU, RAM and processes. Exceeding these can cause 500 errors.
How to diagnose a 500 error
A 500 error is frustrating because it's so general. Here's how to figure out what the problem is:
Step 1: Check error logs
This is the most important step. Error logs tell you exactly what went wrong.
Via cPanel: Go to cPanel > Errors, or cPanel > Metrics > Errors. Here you see the most recent PHP errors.
Via FTP: Error logs are often in /logs/ or /public_html/error_log.
WordPress debug mode: Activate debugging in wp-config.php:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
The error log tells you exactly which file, which line and what the problem is. This is crucial for troubleshooting.
Step 2: Check your recent changes
Did you get the 500 error right after changing something? Then that's probably the cause.
Think about:
- Just installed or updated a plugin?
- Switched or modified theme?
- Updated WordPress?
- Modified .htaccess file?
- Modified php.ini?
If yes, reverse that change.
Step 3: Test with plugins disabled
Disable all plugins to see if a plugin is the problem:
Via FTP: Rename the /wp-content/plugins/ folder to /wp-content/plugins-disabled/. If the site works now, it's a plugin.
Then rename back to plugins/ and disable plugins one by one (rename each plugin folder) until you find the culprit.
Step 4: Switch to default theme
Temporarily switch to a default WordPress theme (Twenty Twenty-Three) to test if your theme is the problem.
Via FTP you can force this by renaming your current theme folder.
Specific solutions for 500 errors
Repair .htaccess
If your .htaccess is corrupt:
- Rename the existing .htaccess file to .htaccess-old (via FTP)
- Test if the site works now
- Generate a new .htaccess by going to Settings > Permalinks in WordPress and clicking Save
- If that works, your .htaccess was the problem
Increase PHP memory limit
Add this to your wp-config.php (above the line "That's all, stop editing!"):
define('WP_MEMORY_LIMIT', '256M');
Or in php.ini:
memory_limit = 256M
Or in .htaccess:
php_value memory_limit 256M
Increase max execution time
In php.ini:
max_execution_time = 300
Or in .htaccess:
php_value max_execution_time 300
Correct file permissions
Standard WordPress permissions:
- Folders: 755
- Files: 644
- wp-config.php: 600 (extra safe)
Via FTP or SSH you can adjust permissions. Many FTP clients have a "File Permissions" option when you right-click a file or folder.
Reinstall WordPress core
If you think WordPress core files are corrupt:
- Download the latest WordPress version from WordPress.org
- Unzip it locally
- Upload ONLY the wp-admin and wp-includes folders (overwrite existing)
- DON'T touch wp-content (that's where your themes and plugins are)
Repair database
If your database is corrupt, add this to wp-config.php:
define('WP_ALLOW_REPAIR', true);
Then go to: yoursite.com/wp-admin/maint/repair.php
This repairs and optimizes your database. Remove this line from wp-config.php afterwards.
Prevention of 500 errors
Regular backups: This is crucial. If everything goes wrong, you can restore to a working version. Use BackupBuddy, UpdraftPlus or your hosting's backup system.
Test updates on staging: Never update plugins, themes or WordPress directly on your live site. Test on staging first.
Monitor resource usage: Keep an eye on your server resources. If you regularly hit limits, upgrade your hosting.
Use reliable plugins: Only install plugins from reputable developers with good reviews and regular updates.
Keep everything up-to-date: Outdated software is often the cause of crashes and 500 errors. Update regularly, but via staging.
Monitoring tools: Use uptime monitoring like UptimeRobot or Pingdom. You get an immediate alert if your site is down.
Error logging: Keep WordPress debug logging on (but don't show errors publicly). This way you see problems before they escalate.
When to contact your hosting provider
Some 500 errors you can't fix yourself:
Server crashes: If the webserver software (Apache, Nginx) itself crashes, you can do nothing. Contact support.
Hosting configuration problems: Server-level configuration errors can only be resolved by the host.
Resource limits: If you constantly hit hosting limits and you've already optimized, it's time for an upgrade.
Database server problems: If the MySQL server is down or overloaded, that's a hosting problem.
DDoS attacks: If your site is being attacked, your hosting provider must mitigate this.
Good hosting providers have 24/7 support and can quickly diagnose and resolve server-side 500 errors.
500 error vs other server errors
It's good to know the difference:
500 Internal Server Error: General server error, cause unknown 501 Not Implemented: The server doesn't support the requested functionality 502 Bad Gateway: The server got an invalid response from an upstream server 503 Service Unavailable: The server is temporarily overloaded or in maintenance (often less bad than 500) 504 Gateway Timeout: The upstream server didn't respond in time
A 503 is often temporary and resolves itself. A 500 indicates an actual problem that must be solved.
Impact on SEO and users
A 500 error is bad for your site:
Direct traffic loss: Visitors can't use your site and leave frustrated.
SEO impact: If your site gives 500 errors for a long time, Google will lower your rankings. A few minutes is no problem, but hours or days is.
Reputation damage: A site that's often down looks unprofessional and unreliable.
Revenue loss: For webshops, every minute of downtime means direct revenue loss.
Therefore always fix 500 errors immediately. It's not a problem that goes away by itself.
Tools for troubleshooting
Browser Developer Tools: The Network tab shows you the exact HTTP status code and response headers.
Online HTTP status checkers: Sites like httpstatus.io can check your site and show the exact error.
Postman: For testing API endpoints and seeing server responses.
Screaming Frog: Can crawl your entire site and identify all 500 errors.
New Relic / Application Performance Monitoring: For advanced server performance monitoring.
Emergency recovery plan
If your website is completely down with a 500 error:
- Stay calm and diagnose: Check error logs first
- Restore from backup: If you have a recent backup, restore it
- Disable plugins: Via FTP, rename the plugins folder
- Switch theme: Force a default theme
- Check .htaccess: Rename or delete it
- Contact hosting: If nothing helps, call support
Have an emergency plan ready before it happens. Know where your backups are, how to get FTP access, and where to contact hosting support.
Frequently Asked Questions
How much does web hosting cost on average?
Web hosting costs between €3 and €15 per month for shared hosting on average. VPS hosting starts around €10-€20 per month, and dedicated servers from €50 per month.
Can I upgrade to a different package later?
Yes, with most hosting providers you can easily upgrade to a larger package when your website grows. This can usually be done without downtime.
Is Dutch hosting better than foreign hosting?
For Dutch visitors, Dutch hosting is often faster due to the shorter distance. Additionally, communication with support is easier and you comply with GDPR legislation.
Was this article helpful?
Compare hosting packages directly to find the best choice for your situation.
Related articles
Migrate website: complete step-by-step plan
Migrating website to new hosting? Follow this step-by-step plan to migrate your website safely and without downtime.
What is PHP Memory Limit? Increase Memory Limit
Discover what PHP memory limit is, why you need to increase it and how to adjust memory_limit for better performance.
301 Redirect: Permanent Redirect Explained
Learn what a 301 redirect is, when to use it and how it affects your SEO.
404 Error: Page Not Found Explained
Discover what a 404 error is, what causes it and how to fix and prevent 404 errors.
503 Service Unavailable: Server Overloaded
Discover what a 503 error means, what causes it and how to fix or prevent it.