Permissions Questions

In your documentation it says:

http://www.suitecrm.com/wiki/index.php/Userguides#Advanced_OpenPortal

“2. Then within your SugarCRM instance set the folders cache, custom, data, modules, & themes to 775 recursively”

I have not meet a host yet that allows anything higher than 755 for folders.

Is 775 necessary?

Also, one thing that has always bothered me about SugarCRM (and thus SuiteCRM) is that the files and folders are downloaded as 777 (which forces us to waste time having to set the correct permissions. For people like me who dont have ROOT access (managed VPS…i dont have the time to manage a vps myself), i have to change permissions via ftp, which usually takes over 2 hours to perform.

Thanks,

Hi there,

Can you set permissions before uploading to save time?

The reason permissions require to be these values is that the software has been designed in a way which requires those levels of permissions.

Thanks,

Will.

Hello,

I use a windows pc as my day to day work pc…I am not aware of a way to change the permissions in a widows environment? Is there a way?

Back to my question about 775. How can we have a truly working SuiteCRM install IF YOU REQUIRE 775? As I said, in over 10 years of using VPS’s, I have not found one host any where in the world that allows anything higher than 644 and 755. So what difference does this make? What can be done?

Also I have 2 issues:

  1. I have ALL the folders set to 755 and all files set to 644. I am, getting ‘undefined’ error messages in many places.

  2. 2 days ago I started entering some of my clients (as accounts and contacts). Today I logged into SuiteCRM to find that there was NO DATA anywhere. All the contacts I added were gone. How does something like this happen. There has been no issues with my VPS during this period of time. And yes I am sure I entered the data,. as I added around 5 accounts, and maybe 8 contacts). So if I had not entered and saved the accounts, then I would not have been able to link the contacts to the accounts.

Since permissions keep on changing, I have written a small script which I added to my crontab which runs every 10 minutes to reset permissions as indicated by Will.

This is the script:

<?php 
function chmod_file_folder($dir) { 
    global $perms; 
             
    $dh=@opendir($dir); 
     
    if ($dh) { 
        while (false !==($file = readdir($dh))) { 
            if($file != "." && $file != ".." && !in_array($file, $perms['exclude_folders']) && !in_array($file, $perms['exclude_files'])) { 
                $fullpath = $dir .'/'. $file; 
                if(!is_dir($fullpath)) { 
                    chmod($fullpath, $perms['file_perms']); 
                }else { 
                    chmod($fullpath, $perms['dir_perms']); 
                    chmod_file_folder($fullpath); 
                } 
            } 
        } 
        closedir($dh); 
    } 
} 

$change_folders = array();
$change_folders[]=array('change_dir' => '.',
                        'file_perms' => 0755,
                        'dir_perms'  => 0755,
                        'exclude_folders' => array('cache', 'custom', 'data', 'modules', 'themes', 'themes'),
                        'exclude_files' => array('config_override.php')
                       );
$change_folders[]=array('change_dir' => 'cache',
                        'file_perms' => 0775,
                        'dir_perms'  => 0775,
                        'exclude_folders' => array(),
                        'exclude_files' => array()
                       );
$change_folders[]=array('change_dir' => 'custom',
                        'file_perms' => 0775,
                        'dir_perms'  => 0775,
                        'exclude_folders' => array(),
                        'exclude_files' => array()
                       );
$change_folders[]=array('change_dir' => 'data',
                        'file_perms' => 0775,
                        'dir_perms'  => 0775,
                        'exclude_folders' => array(),
                        'exclude_files' => array()
                       );
$change_folders[]=array('change_dir' => 'modules',
                        'file_perms' => 0775,
                        'dir_perms'  => 0775,
                        'exclude_folders' => array(),
                        'exclude_files' => array()
                       );
$change_folders[]=array('change_dir' => 'themes',
                        'file_perms' => 0775,
                        'dir_perms'  => 0775,
                        'exclude_folders' => array(),
                        'exclude_files' => array()
                       );

foreach ($change_folders as $this_folder)
  {
    if(isset($perms))
      unset($perms);
    $perms = array();
    $perms['file_perms'] = $this_folder['file_perms']; // chmod value for files don't enclose value in quotes. 
    $perms['dir_perms'] = $this_folder['dir_perms']; // chmod value for folders don't enclose value in quotes. 
    $perms['exclude_folders'] = $this_folder['exclude_folders']; // list of folders to exclude 
    $perms['exclude_files'] = $this_folder['exclude_files']; // list of files to exclude
    chmod_file_folder($this_folder['change_dir']);
//    echo "Changed permissions to: " . $this_folder['change_dir'] . " with : " . $perms['dir_perms'] . "<br>";
  } 

chmod('config_override.php', 0775);
?>

I have tested that it takes just under 10 seconds to execute

Guys I dont think you understand here. IF I SET a FOLDER to 775, NOTHING WORKS. This setting is simply NOT ALLOWED.

You guys might have dedicated servers where you have 100% freedom to do whatever you want, but with EVERY VPS I have had, the host doesnt allow settings above 755 and 644.

I am utterly suprized that this is still an issue today. I have always come back to test SugarCRM over the years, but every time there is always issues and its always related to permissions as it seems. So I go and use vTiger or some other CRM because they just work, no messing around.

Why can’t SuiteCRM (SugarCRM) be this simple, and adopt to typical host settings?

ALSO. any comments or advice on why all my data disappeared?

Hi Austenn01,

It is not always as you say because I am on a shared hosting plan and I am allowed to set any permission to my folders (not to system or pre-instaled ones).

With respect to vTiger: be careful! It is a fork of SugarCRM and it has the same problems.

I believe that, out there, SuiteCRM is the best solution available.

If you use the script I provided, you can use 755 settings instead of 775, and you should be fine.

Note also that the settings suggested for config.php by the SuiteCRM team are:

‘default_permissions’ =>
array (
‘dir_mode’ => 1517,
‘file_mode’ => 420,
‘user’ => ‘’,
‘group’ => ‘’,
),

and 1517 is 2755
and 420 is 644

so they are within the range you say.