You are browsing your website as usual, or opening your app or your content manager, and then disaster strikes: “500 Internal Server Error”. No helpful message, no link to a solution, no “try again” button that works.
Just a blank page, a cryptic 500 error code and a growing sense of helplessness. Your home page is unreachable, your navigation menu no longer responds, your online shop is down. Every minute counts.
For a business whose website relies on an API or a web application, seeing this error on the home page, with pages not found, the about page unreachable and every product gone, is an alarm bell: something is causing the problem at the level of the menu or the data, and you need to track it down by every means available.
The 500 error, known as the “500 Internal Server Error”, is one of the most frustrating HTTP errors on the web. Frustrating because it is deliberately vague and not much help: the server tells you there is a problem on the server, but not which one.
Frustrating too because it can have a dozen different origins: a badly edited .htaccess file, an incorrect PHP configuration, a corrupted public_html directory, a faulty module that needs removing, a misconfigured header, a broken link in the application, or even an outdated standard in your code.
And finally frustrating because every minute your website is unreachable, you lose visitors, data, customers and brand credibility, even with a perfect digital strategy.
But here is the good news: the error is caused by something identifiable, and it can be fixed. In the vast majority of cases, a bit of diagnosis is enough to find the culprit: check the configuration files, read the logs, clear the browser cache, identify which part of the application is failing, or spot the application error in your logs.
This guide gives you every key to avoid the error, optimise your server and take back control, without being a system administrator or a cloud platform expert.
In this article we explain everything: definition, causes, diagnosis strategy, concrete solutions and best practices to make your website more resilient. Whether you run a WordPress site, an online shop, a blog, an API or an app, you will leave with the tools to solve the problem and to stop it happening again.
Your hosting provider’s privacy policy often gives you access to server status pages and support features: start there if you are stuck.
500 error: definition and meaning
What is a 500 Internal Server Error?
The 500 error, officially called “500 Internal Server Error” in the nomenclature of HTTP status codes, indicates that the web server met an unexpected situation that prevented it from processing the user’s request.
In other words: something went wrong on the server side, but the server itself does not know exactly what, or does not want to reveal it for security reasons.
That is precisely what makes this type of error so hard to deal with for the user who receives it: the error message shown on the web page is deliberately generic and uninformative. “The server has encountered an internal error and was unable to complete your request”: this standard wording tells you nothing about where the error comes from or how to resolve it.
The technical definition of the 500 error code is this: it is an HTTP status code from the 5xx family (server-side errors), which indicates that the server met a general problem it cannot solve by itself and that prevents it from processing the client’s request.
Unlike 4xx errors, which point to a problem on the client side (page not found, access denied), the HTTP 500 error is always an internal server error: it happens on the server, not in the browser.
The variants of the 500 error and how they differ
The 500 Internal Server Error is the best known of the 5xx family, but it is not the only one. Here are the main variants you may come across on the web:
The 500 error is the generic code that signals an unspecified internal problem on the server. It is the one we cover in detail in this guide. The 502 Bad Gateway error means the server, acting as a gateway, received an invalid response from an upstream server.
The 503 Service Unavailable error means the server is temporarily unavailable, usually because of overload or maintenance. The 504 Gateway Timeout error means the server did not get a response in time from an upstream server.
These different error codes all have in common that they are server-side problems, but their causes and solutions differ. In this guide we focus exclusively on the 500 error, the most frequent and the most mysterious.
Impact of the 500 error on your site and your SEO
Beyond the immediate frustration, a persistent 500 error has real consequences for your online business. For user experience it is a very negative signal: a visitor who lands on a 500 error page has every reason to leave your site and never come back. For an online shop, every minute of downtime translates directly into lost sales.
For SEO, the consequences can last longer. If Googlebot regularly meets a 500 error on your website, it may decide to visit less often, or even to demote your pages in the search results.
A one-off 500 error generally has no significant impact on your rankings, but an error that lasts several hours or several days can noticeably affect your visibility in search engines.
Fixing the error quickly is therefore a priority, both for your users and for your SEO.
The main causes of a 500 error
Syntax errors in PHP files
The most frequent cause of a 500 error on websites that use PHP, which is the case for WordPress, powering a very large share of today’s websites, is a syntax error in a PHP file. A missing bracket, a forgotten semicolon, a badly declared variable: a single syntax error in a PHP script is enough to trigger a 500 Internal Server Error across the whole website.
This kind of error often follows a manual change to the code: adding a snippet to the WordPress functions.php file, customising a WordPress theme, or editing a PHP configuration file. The server tries to run the PHP script, hits the syntax error and returns a 500 error instead of showing the requested page.
The PHP version installed on the server can also be behind the problem. A PHP script written for a specific version may not work properly with a newer or an obsolete one. Checking compatibility between the PHP version in use and the scripts, plugins and themes installed is an essential step of the diagnosis.
A corrupted or misconfigured .htaccess file
The .htaccess file is an Apache configuration file that controls many aspects of how your web server behaves: URL rewriting rules, redirects, HTTP headers, access permissions and many other settings. A corrupted or misconfigured .htaccess file, or one containing incorrect directives, is one of the most frequent causes of a 500 Internal Server Error.
This often happens after installing a plugin on a WordPress site: many plugins automatically edit the .htaccess file to add their own rules. If one of those rules is incorrect or incompatible with your server configuration, it can trigger a 500 error.
Incorrect permissions on the .htaccess file can also cause a 500 error: if the Apache server does not have the rights it needs to read or run the file, it will return an internal error. The correct permission setting for this file is generally 644 (read/write for the owner, read-only for everyone else).
The PHP memory limit being exceeded
Each PHP script running on your server has a maximum amount of memory it can use: the memory limit. When a script tries to use more memory than the limit allows, the server stops it and returns a 500 error. This type of error is often linked to the PHP memory limit set in the php.ini file or in the WordPress configuration file.
The default memory limit is often too low for WordPress sites with many active plugins, or for online shops with a large product catalogue. Raising the memory limit is usually a simple and quick fix, provided you can reach the server configuration or the php.ini file through your hosting provider.
To check whether the memory limit is behind the 500 error, look at the server logs (error log): you will usually find a message saying “Allowed memory size exhausted” or “Fatal error: out of memory”. That is a clear sign the PHP memory limit is the culprit.
Faulty WordPress plugins and themes
For WordPress sites, which account for a very large share of existing websites, badly coded or outdated plugins are one of the most frequent causes of a 500 error. A plugin that has not been updated for a long time may be incompatible with the current version of WordPress or of PHP, and cause an internal server error.
Conflicts between plugins are another common source of trouble: two plugins can work perfectly on their own yet generate a 500 error when activated together. Finding the plugin responsible means deactivating them one by one until the error disappears.
The active WordPress theme can also be the cause, especially if the theme was recently updated and the new version contains a bug, or if the theme is incompatible with a WordPress or PHP update. Temporarily activating the default WordPress theme (Twenty Twenty-Four or similar) lets you check whether the theme is at fault.
Database problems
Being unable to connect to the MySQL database is another frequent cause of 500 errors, particularly on WordPress sites and web applications that depend on a database to run. If the database server is unreachable, the connection credentials are wrong or the database is corrupted, the site cannot fetch the data it needs and returns a 500 error.
Incorrect or overly heavy MySQL queries can also cause 500 errors: a query that exceeds the maximum execution time allowed by the server will be cut off, producing an internal error. This kind of problem is often seen on sites with a large volume of data or with complex, poorly optimised queries.
Incorrect file permissions
Incorrect permissions on your website’s files and folders are an often overlooked cause of 500 errors. On a Linux/Apache web server, every file and folder has a set of permissions that define who can read, modify and run it.
If those permissions are misconfigured, too restrictive or too permissive, the server may refuse to run the scripts it needs and return a 500 error.
The correct permission setting is generally 755 for folders (read, write and execute for the owner, read and execute for everyone else) and 644 for files (read and write for the owner, read-only for everyone else). Any significant deviation from these standard values can cause access problems and 500 errors.
How to diagnose a 500 error
Start with the server logs
The first reflex when facing a 500 error is to check the server logs, also called the error log. These log files record in detail every error that happened on the server, with the date, the time, the type of error and, crucially, a descriptive message that points to the origin of the problem.
Log files can usually be reached in several ways. Through your hosting provider: most web hosts give you access to the server logs from the dashboard (cPanel, Plesk or a proprietary interface). Through an FTP client: connect to your server with a client such as FileZilla and browse to the root folder of your site (usually public_html or www) to find the error files.
Through SSH: if you have command-line access to the server, the Apache logs are usually located at /var/log/apache2/error.log.
Once you have the server logs open, look for the lines matching the period when the 500 error occurred. The error message will generally tell you the type of error, the PHP file involved, the line number in the script and a description of the problem. That is your starting point for fixing the error.
Enable debug mode in WordPress
On a WordPress site, debug mode (WP_DEBUG) is a valuable tool to diagnose the 500 error. It lets you display PHP error messages directly in the browser, or save them to a dedicated log file, instead of just returning a generic 500 error page.
To enable debug mode, open the wp-config.php file with your FTP client and edit the following lines:
define('WP_DEBUG', true); define('WP_DEBUG_LOG', true); define('WP_DEBUG_DISPLAY', false);
With this setup, PHP errors will be saved to a debug.log file in the wp-content folder of your WordPress site. Check that file after trying to reload the page that triggers the 500 error: you will find the exact error message and the PHP file involved.
Remember to turn debug mode off once the problem is solved by setting WP_DEBUG back to false. Leaving debugging on in production is poor security practice.
Use an FTP client to access the files
An FTP client such as FileZilla, Cyberduck or WinSCP is an essential tool for troubleshooting a 500 error. It lets you reach your website’s files directly on the server, edit, delete or replace them, even when your site’s admin interface is unreachable because of the error.
With an FTP client you can open the .htaccess file to check its configuration, read the log files to find the origin of the error, deactivate plugins by renaming or temporarily deleting them, and restore corrupted PHP files from a backup. It is often the first tool to reach for when the 500 error stops you getting into the WordPress dashboard.
Test page by page to isolate the problem
When the 500 error does not affect every page of your website but only certain URLs, testing access page by page can help isolate the problem. Try several pages in turn, such as the home page, a product page, a blog post and a category page, and note which ones return a 500 error and which work normally.
If the error is tied to a specific URL, it may point to a configuration problem in the .htaccess file (an incorrect rewrite rule), a problem with the content or script behind that page, or a MySQL query problem specific to that type of page. This information is valuable to steer the diagnosis and target the right fixes.
How to fix the 500 error: step-by-step solutions
Solution 1: fix or regenerate the .htaccess file
The first step to fix a 500 error on a WordPress site is often to check and correct the .htaccess file. The simplest method is to rename the existing .htaccess file (for example to “.htaccess_old”) with your FTP client to disable it temporarily, then reload the page.
If the error disappears after renaming the .htaccess, the file was indeed the cause. You can then create a clean new .htaccess file straight from the WordPress dashboard: go to Settings > Permalinks and click “Save Changes”. WordPress will automatically regenerate a new .htaccess file with the default configuration.
If the problem persists after disabling the .htaccess, move on to the next steps.
Solution 2: increase the PHP memory limit
If the server logs point to a memory limit problem, you can raise the PHP memory limit in several ways. The simplest is to add or edit the following line in the wp-config.php file of your WordPress site:
define('WP_MEMORY_LIMIT', '256M');
Another option is to edit the php.ini file directly (if your host gives you access to it) by changing the value of memory_limit:
memory_limit = 256M
You can also add the following line to your .htaccess file:
php_value memory_limit 256M
After making this change, reload the page that was producing the 500 error to check whether it is resolved. If the error persists, move on to the next step.
Solution 3: deactivate the plugins and the WordPress theme
If you suspect a plugin or the active WordPress theme of causing the 500 error, the most effective diagnostic method is progressive deactivation. With your FTP client, go to the wp-content/plugins folder and rename the “plugins” folder to “plugins_old” to deactivate every plugin in one go. Reload the page: if the error disappears, a plugin is indeed responsible.
To identify the culprit, rename “plugins_old” back to “plugins”, then deactivate the plugins one by one from the WordPress dashboard (if you can get in) or by renaming their individual folders over FTP. Reload the page after each deactivation until the error disappears: the last plugin you deactivated is the culprit.
For the WordPress theme, go to the wp-content/themes folder and rename the folder of the active theme to disable it. WordPress will automatically switch to the default theme. If the error disappears, your theme is at fault: check whether an update is available or contact the theme’s support.
Solution 4: check and correct file permissions
To check the permissions on your files and folders, connect to your server with an FTP client or over SSH. In FileZilla, right-click a file or folder and select “File permissions” to view and change them.
The recommended permissions are 755 for folders and 644 for files. For the WordPress wp-config.php file, it is even advisable to restrict permissions to 600 for security reasons. If you find files with incorrect permissions, especially PHP files set to 777 (full access), change them immediately.
Solution 5: check the PHP and MySQL configuration
If the previous steps have not solved the problem, check your server’s PHP configuration. Look at the php.ini file to make sure the PHP version is compatible with your application, that the required PHP extensions are enabled and that the configuration settings (memory_limit, max_execution_time, upload_max_filesize) are correctly set.
For MySQL connection problems, check the connection credentials in the WordPress wp-config.php file (DB_NAME, DB_USER, DB_PASSWORD, DB_HOST) and make sure the MySQL server is reachable. Your hosting provider can help you check the state of the database server and sort out connection problems.
Solution 6: contact your hosting provider’s technical support
If none of the previous solutions has fixed the 500 error, it is time to contact your hosting provider’s technical support. Give them the following information: the exact date and time the error appeared, the URLs affected, the contents of any log files you have been able to read, and the recent changes made to the site (plugin or theme updates, changes to the .htaccess file).
A good web host will have the tools to read the server logs at system level, where you may not have access, and will be able to pinpoint the origin of the problem quickly. Contacting your host’s technical support is often the most effective way to diagnose 500 errors linked to the configuration of the web server itself.
Avoiding 500 errors in the future
Regularly update PHP, plugins and themes
Preventing 500 errors starts with regular updates of every component of your website: the PHP version installed on the server, WordPress itself, the active plugins and the theme. Updates fix bugs, improve security and keep the different components compatible with one another.
Before a major update, always make a full backup of your site, files and database. Test the update on a local or staging environment before deploying it to production. This simple precaution can spare you plenty of nasty surprises and 500 errors in production.
Monitor the server logs continuously
Continuous monitoring of the server logs is a good practice that lets you spot errors before they spread and affect the whole site. Monitoring tools such as UptimeRobot, Pingdom or New Relic can alert you in real time when your website becomes unreachable, so you can step in quickly before your users are affected.
Some hosts also offer built-in monitoring tools that analyse the server logs and raise alerts when an error repeats. Checking the server logs regularly, even when no error is visible, lets you spot problems forming before they become critical.
Choose quality web hosting
The quality of your web hosting is a decisive factor in the stability of your site and how often 500 errors occur. A quality host has a robust infrastructure, responsive and competent technical support, monitoring and automatic backup tools, and a server configuration optimised for web applications such as WordPress.
Avoid cheap shared hosting that overloads its servers with hundreds of websites sharing the same resources: it is often a source of 500 errors linked to server outages or resource overruns. Investing in quality hosting is one of the best preventive measures against recurring 500 errors.
Test before deploying to production
Any change made to your website, whether adding a new plugin, editing the theme, updating a PHP file or changing a configuration, should be tested in a development or staging environment before going live.
A local environment (with XAMPP, MAMP or Local by Flywheel) or a staging environment at your host lets you spot potential problems without affecting your live site.
This good web development practice is particularly important for WordPress sites with a large number of active plugins, where conflicts and incompatibilities are common. It also lets you check compatibility between the different versions of PHP, WordPress and your plugins before any major update.
Web Opteam: your Paris-based agency for solving technical problems
Our technical expertise for your website
At Web Opteam, we regularly work on websites that run into 500 errors and other complex technical problems. Our technical team knows the full range of causes and solutions behind these errors, whether on WordPress sites, WooCommerce online shops, PHP web applications or sites on other platforms. We work remotely with clients worldwide, in English.
Our approach is systematic and effective: we check the server logs, identify the origin of the error, fix the problem in a targeted way, confirm it is resolved and put preventive measures in place so it does not come back. We step in urgently for critical sites such as online shops and ecommerce websites, where every minute of downtime translates directly into lost revenue.
Technical audit and hosting optimisation
Beyond fixing 500 errors, Web Opteam offers complete technical audits of your website: performance analysis, server configuration checks, PHP and MySQL optimisation, file permission checks, clean-up of outdated plugins and setting up a proactive monitoring strategy.
Our goal is to make your website more stable, faster and more secure, so you can focus on your business without worrying about technical problems. If you are facing a 500 error or any other technical problem on your site, contact our team directly: we are here to help you find and fix the problem quickly.
A 500 error is scary, but it can be fixed
The 500 Internal Server Error is certainly mysterious in its message, but it follows a precise technical logic. In the vast majority of cases it is caused by one of these identifiable sources: a syntax error in a PHP script, a misconfigured .htaccess file, an exceeded PHP memory limit, a faulty WordPress plugin or theme, a MySQL database problem or incorrect file permissions.
The method to fix it is always the same: read the server logs to find the origin of the problem, try the solutions one by one until the error disappears, and put preventive measures in place so it does not happen again. With an FTP client, access to the server logs and a bit of method, most 500 errors can be fixed in under an hour.
And if you do not know where to start, or if the problem persists despite your attempts, the Web Opteam team is here to help. We have the tools, the expertise and the experience to diagnose and fix 500 errors, whatever the cause.




