📣 We're Hiring!

Problems with default File Permissions and Ownership

Hi everybody,

I’m in the process of installing suiteCRM-7.11.21 with PHP 7.3 and MySQL 8

The installation, including setting ownership & file permissions according to the install guide (before and after the installation) went through and I can access the CRM. However I encounter some problems with file permissions and therefore getting some weird behaviour.

The weird behaviour I’m talking about was first spotted when I navigated into the admin->studio and the tooltips on the right side were missing, text shown ‘undefined’

I changed the permissions a third time using SSH according to the installer guide and suddenly the tooltips are now getting displayed.

Second strange behaviour, I wanted to change the company_logo.png but after saving the logo doesn’t get displayed. After digging into the system I found out that the new company_logo.png located in /custom/themes/default/images/company_logo.png has the permissions 644

Therefore I suspect, that the permissions for new files are not set correctly. After some research I found out, that there are some options to set the default permissions within the config.php


currently my config.php without any changes is set to:

‘default_permissions’ =>
array (
‘dir_mode’ => 1528,
‘file_mode’ => 493,
‘user’ => ‘’,
‘group’ => ‘’,

Other user suggest to use default permissions as following:
dir_mode = 1517
file_mode = 420

My question is, Am I on to something here or is there a more reasonable explanation to this behaviour?

----------------- update ---------------
I found out, that ‘file_mode’ =>493, is actually an invalid permission (doesn’t exist) can anybody explain why this number is placed in the config.php file? I changed the default permission to 432 according to the SugarCRM post above and voilà I now can change the company logo without running the chmod command afterwards and the logo change works now.

On to the next problem/finding, when I want to change the style under profile->layout options->style from the default “Dawn” to “Dusk” the css doesn’t get displayed correctly. Again after some digging, the folder and file which are responsible for it located in /cache/themes/SuiteP/css/ in this case Dusk which was created after the switch has the wrong permissions. The folder has the permission 770 which should be 775 (according to the install guide) and the style.css file has the permissions 660 instead of 775.

So my question is this behaviour per design, so do I really need to manually run the chmod command to change the permissions of the affected files & directories every time after a change or am I missing something fundamental in terms of permissions here?

You need to enter your web user here.

Find your web user:

Hi, thank you for your reply, unfortunately this information is missing in the install guide. I guess this step should be done directly after the config.php gets created by the installer?

I added the user and group to my config.php and now things look a little better, when I change the style the folder for instance “Dusk” now has the permissions 770 and the style.css inside has the permissions 755.

Unfortunately this permissions are still to low, after manually changing the permissions of the folder and the style.css file to 775 (according to the install guide) everything works as expected.

I guess we are missing out on something else here.

What about the default_permissions I mentioned above, I used a unix permissions calculator and it looks like a permission 493 doesn’t exist which makes sense because 7 is the highest permission you can get.

but hey, I think we are very close to a solution here :wink:

For some reasons (I guess historical) permissions in config.php are defined in octal.
If you need 775, replace 493 by 509

That is right, now I’m also familiar with the system but I’m not sure about this approach. Since changing the default file_mode to 509 would mean ALL new files will have this permission.

But according to the installation guide only certain folders+subfolders+files should have this high (775) permission. Namely:

cache custom modules themes data upload

all other folder and files should remain 755