My site (on a VPS running CPanel, CiviCRM 5.49.3, Drupal 9.3.14) currently has file permission issues. This hasn't always been the case, and I don't know the in initial cause for the problem.

Due to permission issues the caches are inaccessible and the site functionality is very limited.

I have come across advice for a script that set permissions in a way that supports the site functionality.

cd /home/user/www-sangha-drupal/web/
chown -R user:nobody .
find . -type d -exec chmod u=rwx,g=rx,o= '{}' \;
find . -type f -exec chmod u=rw,g=r,o= '{}' \;

cd /home/user/www-sangha-drupal/web/sites
find . -type d -name files -exec chmod ug=rwx,o= '{}' \;
for d in ./*/files
   find $d -type d -exec chmod ug=rwx,o= '{}' \;
   find $d -type f -exec chmod ug=rw,o= '{}' \;

the result is in paths such as


this produces this kind of permission:

-rw-rw---- 1 user nobody  7785 May 28 23:08 crm-l10n.8a45e015fbdc223596bebbac430cb078.js
-rw-rw---- 1 user nobody 10751 May 28 23:08 crm-menubar.d91a640f1e3a566248597efb8795f11b.css

-rw-rw---- 1 user nobody   202 May 28 23:25 .htaccess


When I cleanup caches, this permission changes to

-rw-r--r-- 1 nobody nobody  7785 May 28 23:08 crm-l10n.8a45e015fbdc223596bebbac430cb078.js
-rw-r--r-- 1 nobody nobody 10751 May 28 23:08 crm-menubar.d91a640f1e3a566248597efb8795f11b.css

-rw-r--r-- 1 nobody nobody   202 May 28 23:25 .htaccess

Whereupon the the site doesn't work very well at all, as you might guess.

Here: [https://civicrm.stackexchange.com/questions/4144/civicrm-does-not-have-permission-to-write-temp-files-on-new-server][1] it is suggested to modify


I have tried updating what might be the right instance of this file (there are several with CPanel, so that makes it less certain), and restarting PHP-FPM server each time.

I have tried

listen.acl_users = apache,nginx,user
listen.acl_users = apache,nginx,nobody,user

Neither of these have changed the behavior or functioning of the site, as described above.

Please any suggestions for how to resolve this?


2 Answers 2


This normally happens when you clear cache as user other than the web server user ( like running drush cr as your own user ). I would do the following.

Substitute Apache and YourUser as your Webster and other user in your system (assumes Linux).

  1. First correct current permissions

    Sudo chown -R Apache:YourUser

    Sudo chmod -R ug+rw /path-to-Drupal-root-/web/sites/yourSite/files/civicrm/

  2. Now, clear cache as we server user or via weblink and not commandline If you want use commandline , run as Apache :: sudo -u apache drush cr..

  • one thing I wonder about is CPanel usage of 'nobody' instead of 'apache'. This being the case, would it be correct to use this modified instruction from you: sudo chown -R nobody:user ? May 30, 2022 at 2:22
  • Cpanel has its own file icon where you can fix permissions. It’s been while since I used it. Search their help articles on webserver permissions
    – salah-1
    May 30, 2022 at 2:25

Resolved my problem by changing the php apache module from mod_mpm_event which uses 'nobody'; to mod_mpm_itk which uses 'user'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.