In short
A 500 Internal Server Error is a generic HTTP status code that means the server hit an unexpected error while processing the request. On shared hosting, the most common causes are broken .htaccess rules, wrong file permissions (such as 777), a PHP version mismatch, and exceeding the PHP memory limit. The fastest way to find the exact cause is to read the error logs in cPanel and your site's error_log file.
In this guide
- What exactly does a 500 error mean?
- Step 1: Read the error log
- Step 2: Disable the .htaccess file
- Step 3: Fix file and folder permissions
- Step 4: Fix a PHP version mismatch
- Step 5: Memory limit and timeouts
- Nothing in the log? Turn on debug mode
- Diagnostic flow at a glance
- After the fix: keep it from happening again
- Next step: hosting that makes errors easy to diagnose
A 500 Internal Server Error is a generic error: the server ran into a problem while handling the request but doesn't tell the visitor what it was. In other words, the message doesn't give you the cause, only that something went wrong. The good news: on shared hosting, the vast majority of 500 errors come down to one of four causes, and the server writes the real cause to the error log. In this guide, instead of guessing, we'll follow a step-by-step diagnostic flow that starts with the log.
What exactly does a 500 error mean?
In HTTP status codes, the 5xx family covers server-side errors. 500 Internal Server Error is the generic response returned when no more specific code (like 502, 503 or 504) fits. The web server (LiteSpeed or Apache) either couldn't read a configuration file, a PHP script stopped with a fatal error, or the server refused to run the script for security reasons.
A quick summary so you don't mix up similar codes:
| Code | What it means |
|---|---|
| 500 | Generic server error: configuration, permission or code error |
| 503 | Service temporarily unavailable: maintenance or overload |
| 504 | Gateway timeout: the backend didn't respond in time |
| 508 | The account hit its resource limit (in CloudLinux environments) |
If you see 508 on screen, the problem isn't your code but a resource limit; in that case, go to our 508 Resource Limit Is Reached guide.
Step 1: Read the error log
Start every diagnosis here. A single line in the log can save you hours of trial and error.
- In cPanel, open Metrics > Errors. It lists the latest errors the web server recorded for your account, newest first.
- For PHP errors, open the
error_logfile in your site's root folder (public_htmlor the relevant subfolder) with File Manager. - If you have SSH access, you can watch the last lines directly:
tail -n 50 ~/public_html/error_log
# To watch the error live while refreshing the page:
tail -f ~/public_html/error_logThe messages you see in the log point you straight to one of the steps below:
| Message in the log | Cause | Go to |
|---|---|---|
Invalid command, .htaccess: ... | Invalid line in .htaccess | Step 2 |
is writable by group, Permission denied | Wrong file/folder permissions | Step 3 |
Call to undefined function, syntax error, unexpected | PHP version or extension mismatch | Step 4 |
Allowed memory size of ... bytes exhausted | PHP memory limit too low | Step 5 |
Maximum execution time of ... exceeded | The script timed out | Step 5 |
For more examples of reading logs, see our article on cPanel access and error logs.
Step 2: Disable the .htaccess file
.htaccess is a hidden file that defines web server rules per directory. A single typo in it, or a directive for a module the server doesn't have, takes the whole site down with a 500 error.
- In File Manager, open the Settings menu at the top right and turn on "Show Hidden Files (dotfiles)."
- Rename
public_html/.htaccessto.htaccess.bak. - Refresh the site. If it loads, the problem is in that file.
- Add the file back line by line to find the faulty rule. If you use WordPress, the default rules are:
# 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 WordPressPay special attention to any php_value or php_flag lines in .htaccess; depending on how PHP is run, these directives may not be supported and will cause a 500 error. Change PHP settings from the cPanel interface instead.
Step 3: Fix file and folder permissions
On shared hosting, PHP scripts run with the account user's privileges. In this model, for security reasons, world-writable (777) files and folders won't execute and produce a 500 error. The correct permissions are:
- Folders: 755
- Files: 644
- Sensitive configuration files like wp-config.php: 600 or 640 (if your hosting setup allows it)
Instead of fixing them one by one, you can fix the whole site in bulk via SSH or cPanel Terminal:
cd ~/public_html
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;For files uploaded via FTP, ownership matters too: the files must be owned by your account user. If you see a different user in the ls -la output, open a support ticket to have it corrected.
Step 4: Fix a PHP version mismatch
When an old theme or plugin calls a function removed in a newer PHP version, a fatal error occurs. The reverse is also possible: a new plugin may use syntax that the older PHP version on the server doesn't recognize.
- In cPanel, open MultiPHP Manager or Select PHP Version.
- Note the PHP version used for your domain.
- Switch to a version your application supports and test the site.
- After changing versions, check that the PHP extensions your application needs, such as
mysqli,intl,gdandzip, are enabled.
For a step-by-step walkthrough, see our guide on changing the PHP version in cPanel. In WordPress, if a plugin is causing the problem, temporarily rename the wp-content/plugins folder to disable all plugins, then re-enable them one at a time.
Step 5: Memory limit and timeouts
The Allowed memory size exhausted error means the PHP script exceeded the memory allocated to it. Heavy page builders, large imports and image processing are typical triggers.
- In cPanel, open MultiPHP INI Editor or Select PHP Version > Options.
- Increase
memory_limitas needed (256M is a common starting point for WordPress sites). - For long-running tasks, raise
max_execution_timeto a reasonable value.
In WordPress, you can also define limits in wp-config.php:
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' );These values can't exceed your hosting plan's PHP limit. If the memory error keeps coming back, the problem is less the setting and more the plan's total RAM.
Nothing in the log? Turn on debug mode
Some applications catch errors internally and don't write them to the log. To enable detailed logging in WordPress, add these lines to wp-config.php:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );Errors are written to wp-content/debug.log and aren't shown to visitors. After you fix the problem, set WP_DEBUG back to false. For details, see the official WordPress debugging documentation.
Diagnostic flow at a glance
- Read the error log and note the message.
- Test by renaming the
.htaccessfile. - Fix permissions to 755/644.
- Check the PHP version and extensions.
- Raise the memory and time limits.
- Roll back the latest change (plugin, theme, code update) or restore from backup.
After the fix: keep it from happening again
Many 500 errors show up right after an update. A few habits greatly reduce the chance of running into the same problem again:
- Back up before updating: Back up your files and database before changing a theme, plugin or PHP version. Rolling back is often faster than hunting for the error.
- Make one change at a time: If you update five plugins at once, it's harder to tell which one caused the error.
- Try big changes in a staging environment: Test risky steps like major PHP version upgrades on a copy on a subdomain first.
- Check the error_log file regularly: A constantly growing
error_logis an early sign of warnings that haven't turned into 500s yet. Clearing up those warnings in time prevents future fatal errors. - Delete unused plugins and themes: Old code that's disabled but still installed can cause trouble after a PHP update.
Next step: hosting that makes errors easy to diagnose
The key to fixing a 500 error quickly is easy access to logs and PHP settings. Sunucu Atlas cPanel web hosting plans come with LiteSpeed Web Server and the cPanel interface; you can change the PHP version and limits yourself from the panel. For growing sites that hit frequent memory errors, the SA-CP-5 plan, with 6 GB RAM, a 6-core processor and access and error logs in its feature list, gives you plenty of headroom. For smaller projects, SA-CP-4 with 4 GB RAM is a good middle ground. If you can't interpret a line in your log, add it to a support ticket in Turkish and ask for help.
Frequently asked questions
Is a 500 Internal Server Error caused by the visitor or the server?
A 500 error is server-side; clearing the visitor's browser won't fix it. The cause lies in the web server configuration, file permissions or the site's PHP code.
I get a 500 error in WordPress and can't log in to the admin dashboard. What should I do?
Use File Manager or FTP to rename the wp-content/plugins folder, which disables all plugins. If the site loads, rename the folder back and enable plugins one at a time to find the faulty one.
Will setting file permissions to 777 fix the problem?
No. On shared hosting it usually does the opposite, causing a 500 error and creating a serious security risk. Use 755 for folders and 644 for files.
Where is the error_log file?
PHP errors are usually written to an error_log file in the same folder as the script that failed, most often inside public_html. Web server errors appear under Metrics > Errors in cPanel.
Does a 500 error hurt SEO?
Short-lived errors usually don't cause problems, but if search engine bots see pages returning 500 for a long time, they may crawl less and drop pages from the index. That's why fixing the error quickly matters.