500 and 503 errors can be caused by a malfunction in PHP or a PHP crash. The error message is vague; often, these errors are not related to the web server.
Error:
"Error code: 500 Internal Server Error
The site could be temporarily unavailable or too busy. Try again in a few moments."
Or,
"yourdomain.com is currently unable to handle this request.
HTTP ERROR 500"
Or,
"503 Service Unavailable - The server is temporarily busy, try again later!"
Or,
"503 The server is too busy to handle your request. Please wait a few minutes and try again."
Note:
The exact error might be different on your website.
Applies To:
This guide applies to Web Hosting, Semi Dedicated Hosting, Reseller Hosting, and managed servers.
Solution 01: Change PHP Version
Change the PHP version to an older or more recent one. Do not miss any steps:
- Go to cPanel > Select PHP Version.
- Set "Current PHP version" to a different version.
- Click "Reset to default".
- If your website (e.g., WHMCS) needs IonCube, enable it, and disable Opache.
Note that most WordPress and other websites do not need IonCube.
Do not enable it unless you need it. - Click "Apply".
- Check the website.
- If the issue persists, change to a different version and check again.
- Repeat the process for all available PHP versions until you no longer have the issue.
If changing the PHP version does not solve the error, proceed to the next solution.
Solution 02: Check Resource Usage
If you are getting a 503 error, check the resource usage for CPU, Physical Memory, I/O Usage, IOPS, Entry Processes, and Number of Processes:
- Log in to cPanel.
- Your average usage is listed under the "Statistics" section on the right sidebar in cPanel.
- If any of the above items are above 90%, you might be hitting resource limits, which in turn is triggering the error.
In many cases, resource usage can be reduced by optimizing the website, plugins, and themes.
If your resource usage is high, try to reduce the resource consumption.
If your resource usage remains high after applying the suggestions from the above guide, contact us for a closer look.
If resource usage is not high, proceed to the next solution.
Solution 03: Run a PHP Info Page
- Go to cPanel > File Manager.
- Navigate to the
public_html
directory.public_html
is the root directory of your primary domain.
The root directory is different for other domains and subdomains. You can view the root directories in cPanel > Domains. - Click "+ File" from the top menu and enter
phpinfo.php
in "New File Name". - Select the
phpinfo.php
file and click "Edit" from the top menu. - Type in the following lines in the file:
<?php
echo phpinfo();
?>
- Click "Save Changes".
- Visit
https://yourdomain.com/phpinfo.php
to view the page.
Replaceyourdomain.com
with your actual domain. - This is a very basic PHP page that should not throw any 503 error.
If you do not get any error, there is no issue running PHP on your account.
If you get any error, contact us.
If you do not get any error, proceed to the next solution.
Solution 04: Inspect Error Log
A misconfigured, malformed, or incompatible plugin, theme, or script can cause the error. Find out what is causing it from the error_log file:
- Go to cPanel > File Manager.
- Navigate to the
public_html
directory.public_html
is the root directory of your primary domain.
The root directory is different for other domains and subdomains. You can view the root directories in cPanel > Domains. - Select the
error_log
file. - Click "View" from the top menu.
The error_log
file contains PHP errors, file paths of the PHP scripts, and PHP functions that caused the error. This information should give you a good idea of what is causing the error.
Update the offending plugin, theme, or PHP script to their publicly available latest stable versions downloaded from their original sources.
If that does not solve the error, contact the devs of the offending plugin, theme, or PHP script for support.
PHP functions can throw errors due to incorrect configuration. Check and fix the configuration. Or contact us to get a closer look.