Permissions

I do not understand what permission should I need to set.

Is this correct?

All files and directories (and all files in that directories) to 755
except, files and directories (and all files in that directories): cache custom modules themes data upload config_override.php to 775

After that should I change also and ‘default_permissions’ in config.php and in utils.php?

Hi there,

Yes that is correct. Are you still having issues?

Note: You will also need to set the owner/group user correctly.

Thanks,

Will.

What I need to add in config.php:

'dir_mode' => 493,
'file_mode' => 420,
'user' => ' ',
'group' => ' ',

And what I need to add in utils.php:

'dir_mode' => 02770,
'file_mode' => 0660,
'chown' => ' ',
'chgrp' => ' ',

this i copy/paste of default value, can you please answer me with precise instructions about this?

Nevals these are the values I put both in config.php and in include/utils.php:

‘default_permissions’ =>
array (
‘dir_mode’ => 1533, // equivalent to octal to 2775
‘file_mode’ => 493, // equivalent to octal to 755
‘user’ => ‘’, // you must replace with the actual value
‘group’ => ‘yourgroup’, // you must replace with the actual value
),

You will find that include/utils.php has two instances of default_permissions and you have to replace them both.

As you may have noticed in include/utils.php the key user is called chown and the key group is called chgrp. I believe this is a bug and that they should be replaced with user and group respectively.

Please note also that some may argue that 775 and 755 are not safe enough on a shared hosting environment (or even not safe fullstop!)

So if you don’t want to risk you should put different values for dir_mode and file_mode

In other posts Will has recommended to use:

‘dir_mode’ => 1517, // equivalent to octal to 2755
‘file_mode’ => 420, / equivalent to octal to 644

It’s a matter of your choice.

May I add that, when I used these latter values I continued experiencing permissions problems, while with the values I now use they have been dramatically reduced. But this may be due to my environment and may not happen to others.

Thank you. I changed this but when I delete sugarcrm.log file, SugarCRM create new log file with 0644 instead of 0755

Hmmm… What did I do wrong?

… that’s the point: SugarCRM continuosly messes up permissions! So you have to watch them.

Possibly you should have deleted the entire contents of the cache folder (not the folder itself) and run a quick repair and rebuild before deleting the log file.

I have created a php script for me to reset the permissions to the whole SuiteCRM folders to 775 and 755 accordingly. This script executes in less than 10 seconds and I run it when I touch something in Admin (eg add new things) as well as in a nightly cron job.

Oh, Sugar is so messy… Than this changes in config.php and in include/utils.php are not very reliable

In this case it is best for me to periodically run permission changes:

sudo chmod -R 755 .
sudo chmod -R 775 cache custom modules themes data upload config_override.php

I decided to use this

‘default_permissions’ =>
array (
‘dir_mode’ => 1517,
‘file_mode’ => 493,

Is this ok? Or I need some other values to use for 755 on files and directories?

And I will periodically run permission changes:

sudo chmod -R 755 .
sudo chmod -R 775 cache custom modules themes data upload config_override.php

Will what you think about this?

Hi there,

Permissions vary between different hosting solutions. Our recommended settings are:

‘default_permissions’ =>
array (
‘dir_mode’ => 1517,
‘file_mode’ => 420,
‘user’ => ‘youruser’, // you must replace with the actual value
‘group’ => ‘yourgroup’, // you must replace with the actual value
),

Then running the following commmands inside your SuiteCRM directory:

sudo chown -R youruser:yourgroup .
sudo chmod -R 755 .
sudo chmod -R 775 cache custom modules themes data upload config_override.php

What are the issues you are experiencing?

Thanks,

Will.

Ok, I will try with your recommended settings.

Lot of issues I’m experiencing with SuiteCRM. You can see all my posts with errors problem

I’m on SiteGround hosting and now I will try Hostgator.

Do you have any recommendation for shared hosting where SuiteCRM will work without problems?
I know that you offer hosting but it is too expensive for my little statup

Will please help me about on thing more.

I’m now on VPS and should I use “apache” for user and group

‘default_permissions’ =>
array (
‘dir_mode’ => 1517,
‘file_mode’ => 420,
‘user’ => ‘[color=#ff0000]apache[/color]’,
‘group’ => ‘[color=#ff0000]apache[/color]’,
),

amariussi, can you please send me that php script?

Nevals, any luck w/your user & group settings?

Hello Dusza,

I really don’t know :slight_smile:

I set permissions in accordance with the Will’s instructions and each time when I change something in SuiteCRM Admin after that I run commands:

sudo chown -R youruser:yourgroup .
sudo chmod -R 755 .
sudo chmod -R 775 cache custom modules themes data upload config_override.php

For now I have no problems with permissions

Hi Amariussi, would you mind sending me this script, it would really help me, I’m not much of a programmer so wouldn’t be able to make one myself but I can implement one. Can you also explain what “user” and “group” means in relation to a hosted platform.

Thanks in advance.

As per your request I am attaching a script that changes permissions to your SuiteCRM files and folders.
The script doesn’t affect owner or group.

To run the script you have to place it in the SuiteCRM root folder and run it as a web application. For example: www.mysite.com/suitecrmrootfolder/chperms.php

(where you have to change “mysite.com” to the real domain of your site and “suitecrmrootfolder” to the path to the suiteCRM root folder).

If you open the script you will see that it is a quick and dirty script which could be improved in programming style and user interface. In any case it works fine.
If you want to see what it does you have to change the first line:

$chmod_debug_mode = FALSE;

to:

$chmod_debug_mode = TRUE;

However I do not recommend it because the script will become very slow (instead of a few seconds it will take several minutes)

You may also change the permissions it sets by editing the $change_folders arrays. Currently it sets everything to 755 except the following folders: cache, custom, data, modules, themes, upload and the file config_override.php, which it all sets to 775.

Personally I have set a cronjob that runs the script once every hour. I cannot recommend any usage but that’s the way I use it.

Additionally I run it before and after everytime I have to use the admin part of the SuiteCRM, or if I have to modify some custom code, just in case…

I hope you will find it useful.

A.

Thank you Amariussi, sorry I didn’t acknowledge sooner. Things were hectic around that time, I am doing a fresh install of Suitecrm so will try this out.

Have a good day. :slight_smile:

Hello.
I have 1 question and 1 proposal

Question: bellow there was assumption that in /include/utils.php there is bug. Where you have chown & chuser, but there must be user & group. So tell me please, that is bug or it must be like that?

Proposal I’m addressing to SuiteCRM staff:
Could you please update your installation guide with permissions recommendations from that tread?

I’m talking about:

  1. changes in /crmfolder/config.php
  2. changes in /crmfolder/include/utils.php
  3. chmod -R 755 && chmod -R 775 cache custom modules themes data upload config_override.php

Up.
I still confused regarding the ‘bug’ that I mentioned in last post.