Guides & Tutorials7.5 Update TroubleshootingTroubleshooting an Action Hook could not load file Error

Troubleshooting an Action Hook could not load file Error

An action hook file may fail to trigger, despite the file being present in the /includes/hooks directory or loaded as part of a module.

Cause

An error with the hook file or its code meant it could not be successfully loaded, and as such it was not loaded.

The error message will provide additional details as to the specific nature of the problem; it could contain a coding syntax error, have been encoded with an old version of Ioncube Loaders or written for a different version of PHP.

Troubleshooting

  1. Navigate to Setup > General Settings > Other tab
  2. Enable the Hooks Debug Mode option
  3. Click Save Changes
  4. Perform the necessary actions to trigger the action hook point
  5. Disable the Hooks Debug Mode option
  6. Click Save Changes
  7. Navigate to Utilities > Logs > Activity Log
  8. Look for an entry like:
Could not include file: /path/to/whmcs/includes/hooks/filename.php

Solution

The file can be deleted from your WHMCS installation via FTP to resolve the immediate error. It would then be necessary to work with the author of the file to resolve the specific error encountered.

A syntax error indicates a mistake in the code or a partially uploaded file.

An Ioncube or PHP error indicates that the file is not packaged in a compatible way with your particular server environment.