Fatal Error Fetching Update

Problem

You see the following error while updating WHMCS using the Automatic Updater feature at Utilities > Update WHMCS:

A fatal error occurred while fetching the update

Cause

This error may occur due to issues with PHP, your server, or your network.

Troubleshooting

To troubleshoot this, you can also use your browser’s network analyzer developer tool to view the raw server response:

  1. Open your browser’s network analyzer tool.
  2. Return to Utilities > Update WHMCS.
  3. Click Begin Update and follow the instructions to begin the update process.
  4. In the network analyser, select the update.php entry.
  5. Select the Response tab. This may confirm a PHP error or server timeout message.

Check PHP Requirements

This issue may occur if your PHP version does not meet WHMCS’s system requirements.

To check this, go to Utilities > System > PHP Info.

Solution

Update PHP to meet the requirements for automatic updates.

Check Your Server

Check for configurations on your server that may terminate automatic updates before they finish.

Often, these issues occur because of timeouts due to the Apache® TimeOut directive, LiteSpeed Connection timeouts, NGINX® proxy_read_timeout settings, or CloudLinux™ IO and IOPS limits.

Test PHP Execution Length

If the above issues are not the cause of your error, you may want to check to confirm that PHP scripts can run until the WHMCS-defined max_execution_time limit of 300 seconds.

To do this:

  1. Upload the test_execution_time.php file to your WHMCS directory.

  2. Make a cURL request to that file. For example:

    curl https://example.com/test_execution_time.php

    A successful test will, after 280 seconds (the defined value in the test script), yield a response similar to this:

    shutdown function called after 281.08206486702 seconds.

Any other response indicates that the script was terminated before 280 seconds:

ResponseDescription
No response.A fatal PHP error occurred. For example, you would not receive a response if your max_execution_time value is less than 280. Check your max_execution_time value.
Internal Server ErrorA general failure. Review the server error logs.
Another HTTP error status code.Work with your system administrator or hosting provider to troubleshoot and resolve the error.

Workaround

You can work around this issue by performing a manual installation.

Last modified: October 30, 2024