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

https://support.sugarcrm.com/Knowledge_Base/Platform_Management/Setting_Default_File_Permissions_and_Ownership_Via_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

1 Like

Iā€™m also having an issue with permissions. For example, there are lots of ā€˜cacheā€™, ā€˜dateā€™ folders etcā€¦do I have to individually given them the enhanced 775 permissions? It has taken ages and Iā€™m still not able to (for example) save new fields in my installation.
Thanks :slight_smile:

I think Iā€™m having some issues with permissions, however it might have something to do with the stream_metadata issue.

does anyone know how to convert suitecrm permissions to linux permissions like
1528 > 755 etc

Go here

and put the 1528 into the decimal box. The Linux permissions appear in the octal box.

1 Like