Problem
You see the following error in your PHP error_log file or in the Activity Log at Configuration () > System Logs when importing certain emails into the support ticket system:
TypeError: Return value of WHMCS\File::guessFileExtension() must be of the type string, null returned in /path/to/whmcs/vendor/whmcs/whmcs-foundation/lib/File.php
Cause
The fileinfo function is missing or disabled in your server’s PHP configuration.
This is a standard PHP function. WHMCS requires it in order to identify the file extension of email attachments when importing them into the support ticket system.
Solution
This troubleshooting information only applies to self-hosted WHMCS installations.
Work with your hosting provider or system administrator to enable the fileinfo function in your PHP configuration.
To confirm that you have successfully enabled it:
- Log in to the WHMCS Admin Area.
- Go to Utilities > System > PHP Info.
- Find the
fileinfoextension in the list and check its status:
Last modified: 2025 October 17