Jump to content

Impossible to create the root directory: Permission Denied


kwood

Recommended Posts

Hi,

I have created a separate folder for my cron jobs, following the WHMCS user guide for security, which it stated in the System Health Check area.

It all changed fine, and the crons are running from the new folder, but when I go to enter the System Health Check area I get the following:

 

League\Flysystem\Exception: Impossible to create the root directory "........./dashboard/cron_jobs". mkdir(): Permission denied in ........../dashboard/vendor/league/flysystem/src/Adapter/Local.php:112
Stack trace:
#0 ..........dashboard/vendor/league/flysystem/src/Adapter/Local.php(78): League\Flysystem\Adapter\Local->ensureDirectory('p...')
#1 ..........dashboard/vendor/whmcs/whmcs-foundation/lib/View/Admin/HealthCheck/ApplicationDirectory.php(0): League\Flysystem\Adapter\Local->__construct('p...')
#2 ..........dashboard/vendor/whmcs/whmcs-foundation/lib/View/Admin/HealthCheck/HealthCheckRepository.php(0): WHMCS\View\Admin\HealthCheck\ApplicationDirectory->__construct('p...')
#3 ..........dashboard/vendor/whmcs/whmcs-foundation/lib/View/Admin/HealthCheck/HealthCheckRepository.php(0): WHMCS\View\Admin\HealthCheck\HealthCheckRepository->newApplicationDirectory('p...')
#4 ..........dashboard/vendor/whmcs/whmcs-foundation/lib/View/Admin/HealthCheck/HealthCheckRepository.php(0): WHMCS\View\Admin\HealthCheck\HealthCheckRepository->customizableDirectories()
#5 ..........dashboard/vendor/whmcs/whmcs-foundation/lib/View/Admin/HealthCheck/HealthCheckRepository.php(0): WHMCS\View\Admin\HealthCheck\HealthCheckRepository->checkDirectoryCustomizations()
#6 ..........dashboard/admin/systemhealthandupdates.php(0): WHMCS\View\Admin\HealthCheck\HealthCheckRepository->nonKeyChecks()
#7 {main}

Please, can anyone advise what I need to do?

 

Many thanks

Link to comment
Share on other sites

Looks like a permission issue, probably an incorrect owner of the directories / files. First you should check under which user PHP runs, then check if the owner is correctly set for your WHMCS directory and fix it if not (`chown -R USER:GROUP /path/to/whmcs`).

Link to comment
Share on other sites

3 minutes ago, string said:

Looks like a permission issue, probably an incorrect owner of the directories / files. First you should check under which user PHP runs, then check if the owner is correctly set for your WHMCS directory and fix it if not (`chown -R USER:GROUP /path/to/whmcs`).

Hi,

Thanks, but what I do not understand is, that I didn't alter anything with the directory, I h=just added a new folder for my cron jobs, which all worked fine, yet the health check page is now showing this.

Link to comment
Share on other sites

The error message clearly indicates that PHP lacks the permission to create the directory. The most common explanation is that the owner (chown) or permission (chmod) is not correct. I don't think it's the permissions, since the permissions are usually set to 0755 for folders and 0644 for files by default.

I'm also unsure why the health check would even attempt to create this directory. Since WHMCS is encrypted, I can't figure that out, but maybe the health check will do that if the configured cron directory does not exist. So I would recommend that you also double check the path you configured.

Link to comment
Share on other sites

8 minutes ago, string said:

The error message clearly indicates that PHP lacks the permission to create the directory. The most common explanation is that the owner (chown) or permission (chmod) is not correct. I don't think it's the permissions, since the permissions are usually set to 0755 for folders and 0644 for files by default.

I'm also unsure why the health check would even attempt to create this directory. Since WHMCS is encrypted, I can't figure that out, but maybe the health check will do that if the configured cron directory does not exist. So I would recommend that you also double check the path you configured.

I'm unsure too, as the new path to the Cron jobs is working fine, as I checked this on the Cron page in WHMCS and it has directed the change and it has accepted it and they are all running correctly too. This is strange, and I couldn't understand it, hence why I have asked on here. 

Thanks for your help.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated