A 500 Internal Server Error means the web server encountered an unexpected condition and could not complete the request. In a hosting environment, this usually points to a problem in the website’s application code, server configuration, PHP runtime, permissions, or a resource limit. The error is generic, so the exact cause is often hidden until you check the server logs and test the site step by step.
If your website shows a 500 error in a managed hosting or control panel environment such as Plesk, the fastest way to resolve it is to identify whether the issue comes from a recent change, a broken configuration file, a plugin or theme conflict, or a server-side limit. In most cases, you can narrow it down quickly with a structured troubleshooting process.
What a 500 Internal Server Error means
A 500 error is a server-side HTTP error. Unlike client-side errors such as 404 Not Found, it does not mean the page is missing from the browser. It means the server received the request, but something failed while processing it.
Common reasons include:
- Broken .htaccess or web server configuration
- PHP fatal errors or incompatible PHP extensions
- Incorrect file or folder permissions
- Exhausted memory or execution time limits
- Faulty CMS plugins, modules, or themes
- Database connection issues
- Malformed application code or missing files
- Problems after a migration, update, or deployment
Because the message is generic, the most important task is to determine where the failure happens: at the web server level, in PHP, in the application, or in the database layer.
Start with the fastest checks
Before changing files or settings, confirm whether the issue is site-wide or only affects one page. If only one URL returns a 500 error, the problem is likely local to that application route, plugin, or template. If the whole website is affected, look at global configuration, permissions, or PHP settings first.
1. Refresh the page and try another browser
Sometimes a temporary server hiccup or a cached response can make the issue look worse than it is. Open the site in an incognito/private window or test it in another browser. If you manage the site through a control panel, also test the domain directly rather than through a cache layer or proxy.
2. Check whether there was a recent change
Most 500 errors appear after:
- a CMS core update
- plugin or extension installation
- theme replacement
- deployment of new code
- editing .htaccess or nginx rules
- changing PHP version or handlers
- restoring a backup
If the error started immediately after a change, revert that change first. That is often the fastest fix.
3. Check the website error log
The error log is usually the most valuable source of information. In Plesk, you can typically access logs from the domain’s logs section. In Apache-based hosting environments, the log may show the exact PHP fatal error, permission issue, or configuration problem.
Look for messages such as:
- PHP Fatal error
- Allowed memory size exhausted
- Premature end of script headers
- Permission denied
- Rewrite rule error
- File not found in include path
- Database connection failed
Even one line from the log can point you directly to the cause.
Check the .htaccess file
A corrupted or invalid .htaccess file is one of the most common causes of 500 Internal Server Errors on Apache and Apache-compatible hosting environments. A small syntax mistake, unsupported directive, or broken rewrite rule can stop the site from loading.
How to test .htaccess safely
- Rename the existing .htaccess file to something like .htaccess_backup.
- Reload the website.
- If the site works again, the problem is in that file.
- Generate a fresh .htaccess file from the CMS or copy a known-good version.
If you use WordPress, for example, you can often restore the standard rewrite rules from the admin area by saving the permalink settings again. For other applications, review custom rewrite directives, security rules, and any lines added during a migration.
Pay special attention to:
- unsupported Apache directives
- syntax errors
- broken RewriteRule conditions
- references to missing files or folders
- rules copied from another server environment
Verify file and folder permissions
Incorrect permissions can trigger a 500 error because the web server cannot read or execute the files it needs. This is especially common after uploads, restores, or deployments.
Typical permission values
- Folders: 755
- Files: 644
- Configuration files may require stricter access depending on the application
Executable scripts should also have proper ownership. If files were uploaded by the wrong user or restored with incorrect ownership, the web server may fail even when permissions look correct.
In a managed hosting control panel, verify:
- the document root ownership
- that no files are set to 777 unless explicitly required, which is generally not recommended
- that sensitive folders are not blocked by custom ACLs or security rules
Review PHP version, handlers, and limits
Many 500 errors are caused by PHP incompatibility rather than the web server itself. A site may work on one PHP version and break on another because of deprecated functions, missing extensions, or stricter runtime behavior.
What to check in your hosting panel
- Active PHP version for the domain
- PHP handler or FPM configuration
- Enabled PHP extensions
- memory_limit
- max_execution_time
- upload_max_filesize and post_max_size
If the error began after a PHP upgrade, switch temporarily to a compatible version and test again. If the site works after downgrading, update the application code or plugins before moving back to the newer version.
Common PHP-related symptoms
- Blank page with a 500 error
- Error only on pages using a specific plugin or module
- Fatal error after a form submission
- Error after importing large files
If possible, enable PHP error logging for the site so that you can see the specific fatal error instead of only the generic HTTP response.
Test for plugin, module, or theme conflicts
In CMS-based sites, a 500 error is often caused by a faulty extension rather than the core platform. This is common in WordPress, Joomla, Drupal, and similar systems.
How to isolate the conflict
- Disable all non-essential plugins or extensions.
- Test the site again.
- If it works, re-enable components one at a time.
- Stop when the error returns to identify the culprit.
If you cannot access the admin area, disable plugins by renaming their folder in the file manager or via FTP/SFTP. For themes, switch to a default or built-in theme to see whether the issue disappears.
Typical conflict sources include:
- security plugins with strict rules
- page builders with outdated dependencies
- caching plugins after an incomplete update
- custom themes with PHP errors
- extensions that are not compatible with the current PHP version
Check database connectivity and application settings
Some applications return a 500 error when they cannot connect to the database or when configuration files contain the wrong credentials. This often happens after a migration, restore, or database password change.
What to verify
- database name
- database user name
- database password
- database host
- table prefix, if the application uses one
In many hosting environments, the database host is localhost, but that is not always the case. If the site was moved to a different platform or server, make sure the application’s config file matches the current database details exactly.
Signs of a database issue may include:
- error pages after login or checkout
- site loads partially but specific pages fail
- database-related messages in the error log
- slow responses followed by a 500 error
Look for resource limits or server overload
If your site consumes too much memory, CPU, or execution time, the server may terminate the request and return a 500 error. This is common on busy sites, heavy plugins, large imports, or poorly optimized custom code.
Possible causes
- memory exhaustion
- long-running scripts
- large image processing tasks
- backup jobs running at the same time as web requests
- high traffic spikes
- external API timeouts
To troubleshoot, review the logs for timeout or memory messages. If the issue happens during specific actions such as uploading files, generating reports, or sending emails, that action may need optimization or higher limits.
Depending on your hosting plan and server setup, you may be able to adjust PHP limits in the control panel. If the limits are already reasonable, the underlying code may need improvement rather than higher resources.
Restore missing or corrupted application files
Incomplete updates and failed deployments can leave the site in a broken state. If a core file, include file, or library is missing, the application may stop with a 500 error.
When to suspect file corruption
- the site broke during an update
- files were transferred manually
- a backup was restored only partially
- security software removed a file
- the error started after a failed deployment
Compare the current installation with a clean package or restore the affected files from a trusted backup. If only one component is damaged, replacing that component may be enough without touching the rest of the site.
Test with error display enabled in a safe way
On production websites, you should avoid exposing detailed error messages to visitors. However, during troubleshooting, enabling error logging can help identify the source of the problem without showing the details publicly.
Use logging rather than full display where possible. In managed hosting environments, this may be done through PHP settings in the panel or within the application’s configuration. After collecting the needed information, disable verbose error output again.
Useful debugging clues include:
- the exact file causing the error
- the line number
- the extension or function involved
- the request that triggers the failure
How to troubleshoot a 500 error in Plesk
If your hosting account uses Plesk, you can usually narrow down the issue without command-line access. Start with the domain’s log entries, then review the PHP settings and web server configuration from the control panel.
Plesk checklist
- Open the domain’s logs and inspect recent errors.
- Check the selected PHP version and handler.
- Review custom PHP settings such as memory_limit and max_execution_time.
- Confirm that the document root and .htaccess file are correct.
- Temporarily disable extensions or plugins if the application allows it.
- Use the file manager to rename .htaccess or suspicious folders for testing.
If the domain uses both Apache and nginx, remember that a configuration issue in either layer can surface as a 500 error. A malformed rule, proxy directive, or rewrite conflict may affect only certain URLs.
How to troubleshoot after a migration
Website migrations are a frequent trigger for 500 errors because they can expose hidden dependencies. The site may work on the old server but fail on the new one due to differences in PHP, extensions, file paths, or permissions.
Migration checks
- confirm that all files were copied completely
- verify database import success
- check application config files for new credentials
- review PHP version compatibility
- regenerate cache and temporary files
- replace any server-specific rewrite rules
If a migrated site returns a 500 error only on one environment, compare the server logs and configuration settings between the old and new setups.
When to clear cache and when not to
Cache can hide the real problem or make the website appear inconsistent during troubleshooting. Clearing application cache, object cache, and browser cache can help after you fix the root cause. However, cache rarely causes a true 500 error by itself unless a cache plugin or caching layer is misconfigured.
Use this order:
- Identify and fix the root cause.
- Clear application and server-side cache.
- Clear browser cache and test again.
If the site is behind a CDN or proxy, purge that layer too after the fix.
Preventing 500 errors in the future
Although not every 500 error can be avoided, many can be prevented with good maintenance practices.
- Keep CMS core, plugins, and themes updated.
- Test updates in a staging environment first.
- Use compatible PHP versions for each application.
- Back up the site before making changes.
- Monitor error logs regularly.
- Avoid editing .htaccess without a backup.
- Use trusted extensions and remove unused ones.
- Review permissions after restores and migrations.
For larger or business-critical sites, regular health checks are especially useful because small configuration changes can cause a site-wide outage if they are not tested properly.
FAQ
Is a 500 Internal Server Error always caused by the hosting server?
No. The error is returned by the server, but the root cause may be in your application code, PHP configuration, database settings, or a broken rewrite rule. Hosting issues are only one possible source.
Why does my site work in one browser but show a 500 error in another?
This is uncommon for a true 500 error. It may indicate caching, a cookie/session issue, or a temporary response. Test in a private window and check the server logs to confirm whether the error is real and consistent.
Can a bad plugin cause a 500 error on the whole website?
Yes. A plugin can trigger a fatal PHP error or load incompatible code during every request, which can bring down the entire site. Disabling plugins is one of the first steps in CMS troubleshooting.
What is the first file I should check?
In Apache-based hosting, check .htaccess first if the error started after rewrite or permalink changes. If not, check the error logs and application config files next.
Should I increase PHP memory_limit to fix every 500 error?
No. Increasing memory may help only if the logs show memory exhaustion. If the real cause is a broken file, invalid syntax, or permissions problem, higher limits will not solve it.
How do I know if the problem is in Apache or PHP?
Apache-level issues often appear after a configuration change or invalid directive in .htaccess. PHP issues usually show a fatal error, missing function, or memory problem in the logs. If you can separate the layers by testing .htaccess, PHP version, and application plugins, the cause becomes clearer.
Why did the error appear after a migration?
Migrations often expose differences in server settings, PHP versions, extensions, file ownership, or configuration paths. A site that worked on the old environment may require adjustments before it runs correctly on the new one.
Conclusion
To fix a 500 Internal Server Error, work from the most likely and easiest causes first: recent changes, logs, .htaccess, permissions, PHP compatibility, plugin conflicts, database settings, and resource limits. In hosting environments with a control panel such as Plesk, the logs and PHP settings are usually the fastest place to start. Once you identify the exact error, the fix is typically straightforward.
If the error persists after checking logs and configuration, collect the exact log message, the affected URL, and the time the issue started. That information makes it much easier to isolate the root cause and restore the website quickly.