How to fix 500 internal server error and 503 server busy error?

 

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:

  1. Go to cPanel > Select PHP Version.

  2. Set "Current PHP version" to a different version.

  3. Click "Reset to default".

  4. 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.

  5. Click "Apply".

  6. Check the website.

  7. If the issue persists, change to a different version and check again.

  8. 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:

  1. Log in to cPanel.

  2. Your average usage is listed under the "Statistics" section on the right sidebar in cPanel.

  3. 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


  1. Go to cPanel > File Manager.

  2. 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.

  3. Click "+ File" from the top menu and enter phpinfo.php in "New File Name".

  4. Select the phpinfo.php file and click "Edit" from the top menu.

  5. Type in the following lines in the file:

    <?php
    echo phpinfo();
    ?>

  6. Click "Save Changes".

  7. Visit https://yourdomain.com/phpinfo.php to view the page.

    Replace yourdomain.com with your actual domain.

  8. 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.

 

  • 327 Users Found This Useful
Was this answer helpful?

Related Articles

How to reset or regenerate the .htaccess file in WordPress?

A [.htaccess] file is a configuration file that tells your server how to handle certain things on...

How to deactivate plugins when not able to access WordPress admin?

Often during troubleshooting, you may need to deactivate all plugins and activate them one by...

How to fix errors after migrating WordPress?

  Migrations from cPanel-based servers are usually seamless. But sometimes, a few issues might...

Fix missing MySQL extension or PHP extension or session error

  The most common reason for the error is using an invalid PHP handler/directive in the...

Fix incorrect PHP handler or session path

  Server software and configuration can vary from provider to provider, which in turn causes...