Troubleshooting Impossible to create the root directory Errors
Symptoms
An Oops error page may occur when sending an email via WHMCS or accessing the Utilities > System > System Cleanup page.
With the Display Errors option enabled, the following detail is provided:
League\Flysystem\Exception: Impossible to create the root directory "/folder/path". in /path/to/whmcs/vendor/league/flysystem/src/Adapter/Local.php:106
This message is typically encountered after moving a WHMCS installation to a new location.
Cause
This error is reporting that the storage location for email attachments cannot be read or created. Even if the email being sent does not contain an attachment, the storage location should still be readable by WHMCS at all times.
Solution
The solution to this error is to ensure the Storage Settings are correctly defined:
1. Navigate to Configuration > System Settings > Storage Settings > Configurations tab
2. Click the play icon next to each storage location to test it:
3. The test results are displayed in the top right corner; green for success and red for an error:
4. Once the failing storage location has been identified, the next step is to create a valid location and switch over
5. Click the copy icon next to the failing storage location:
6. Specify the correct path to the WHMCS Attachments directory
7. Click Save Changes
8. The page will re-load and the new storage location is listed
9. Click the Settings tab
10. Use the dropdown menus to change references to the failing storage location to the newly created valid location. Specifically for this error:
- Client Files
- Email Attachments
- Ticket Attachments
11. Click the Switch button and then Continue:
12. Repeat the process for each failing storage location
We suggest dividing the file types up between storage locations as follows:
File Type | Directory |
---|---|
Client Files |
/attachments |
Downloads |
/downloads |
Email Attachments |
/attachments |
Email Template Attachments |
/downloads |
Project Management Files |
/attachments/projects |
Ticket Attachments |
/attachments |