Install SuiteCRM 7.11.15 on a shared hosting

Hi!

I need to install SuiteCRM 7.11.15 on a shared hosting.

What installation procedure should I carry out, in particular with file and folder permissions?

For example, how should I execute these commands with an FTP client? Can you clarify ideas on how to manage permissions with the FTP client compared to a non-shared server?

sudo chown -R www-data:www-data .
sudo chmod -R 755 .
sudo chmod -R 775 cache custom modules themes data upload
sudo chmod 775 config_override.php 2>/dev/null

How config.php must be?

array (
‘dir_mode’ => XXX,
‘file_mode’ => XXX,
‘user’ => ‘XXX’,
‘group’ => ‘XXX’,
),
?

Thanks!

Assume you have no terminal access what so ever?, If that’s the cause you will have to upload the files (usually zipped or compressed) in a method which will maintain the the permissions, the commands you have look good however chances are the user and group names will be different and not default on shared hosting.

I believe the default config.php file perms should be sufficient however I’ll check that over for you.

Hi Mac-Rae,

yes, I don’t currently have ssh access, so I would like to proceed exactly with the cPanel and FTP client tools

  • unzip SuiteCRM-7.11.15.zip on my computer
  • open the SuiteCRM-7.11.15 folder, select the content and upload it via FTP to my hosting (“crm” folder which is used by my sub-domain crm.mydomain.com)
  • I apply via FTP to all files and folders (recursively) the permissions 755
  • I apply the permissions 775 via FTP to cache custom modules themes data upload (recursively)
  • there would be config_override.php 775, but this file is created after installation, then 775 after, right?

And how config.php must be?

array (
‘Dir_mode’ => XXX,
‘File_mode’ => XXX,
‘User’ => ‘XXX’,
‘Group’ => ‘XXX’,
)
?

If I read the parameters in FTP, I see owner 1463, group 1461, what does that mean?

Is everything correct so far?

Do I need to apply the permissions again after installation? Before logging in for the first time or after logging in for the first time?

About the database collation, OK utf8_general_ci?

I read somewhere that modifying include/utils.php correctly solves many permissions problems, for example as standard there is 2 times:

'default_permissions' => array(
    'dir_mode' => 02770,
    'file_mode' => 0755,
    'chown' => '',
    'chgrp' => '',
),

I think that ‘dir_mode’ => 02770, was wrong, but must be
'dir_mode' => 02775,
or
'dir_mode' => 0775,

A replay, please!

File permissions don’t mean anything without the ownerships.

Unless your user and group ownership is correct, you won’t go very far.

Do you have SSH access?

In Admin/Schedulers, at the bottom, there are instructions about setting up cron, where SuiteCRM includes your web server-user name (which is what you should use as owner).

What do those instructions say, exactly?

Hi!

As said I’m in a shared hosting without SSH access and I work with FileZilla, these are my steps:

  • unzip SuiteCRM-7.11.15.zip on my computer
  • open the SuiteCRM-7.11.15 folder, select the content and upload it via FTP to my hosting (“crm” folder which is used by my sub-domain crm.mydomain.com)
  • I apply via FTP to all files and folders (recursively) the permissions 755
  • I apply the permissions 775 via FTP to all files and folders (recursively) to cache custom modules themes data upload
  • installed SuiteCRM
  • config_override.php permissions 775

The first thing I noticed, for example, is the “undefinied” problem, verifying that some folders created in the cache have 770 permissions. Reapplying the permissions 775 I solved the “undefinied” problem.

Admin/Schedulers:
sudo crontab -e -u mypersonalftpusername

At this point I am ready to reinstall all over again, what do you advise me to do in include/utils.php?

'default_permissions' => array(
    'dir_mode' => 02770,
    'file_mode' => 0755,
    'chown' => '',
    'chgrp' => '',
),

Don’t you think it should change 'dir_mode' => 02770,?

On my shared hosting I think the 770 permissions are not good, better 775, but I don’t understand this format 02770 with the initial 02, can you help me understand? Can I use 02775?

On FileZilla I see Proprietary 1463, Group 1461

Help me understand if I have to write these values in
‘default_permissions’ => array(
‘dir_mode’ => 02775,
‘file_mode’ => 0755,
‘chown’ => ‘’,
‘chgrp’ => ‘’,
),
or
‘default_permissions’ => array(
‘dir_mode’ => 0775,
‘file_mode’ => 0755,
‘chown’ => ‘’,
‘chgrp’ => ‘’,
),
or
‘default_permissions’ => array(
‘dir_mode’ => 0775,
‘file_mode’ => 0755,
‘chown’ => ‘mypersonalftpusername’,
‘chgrp’ => ‘mypersonalftpusername’,
),
or
‘default_permissions’ => array(
‘dir_mode’ => 0775,
‘file_mode’ => 0755,
‘chown’ => ‘1463’,
‘chgrp’ => ‘1461’,
),
?

Thanks!

Normally it’s not necessary to change anything in default_permissions array.

If your web server user name is mypersonalftpusername, as I would expect if those scheduler instructions mention it, then you would just need to make sure that all your files and folders are owned by that user. But in shared hostings this should be enforced on you by default.

If the user trying to access the files is the owner of the files, only the first number of the permissions triplet is used. So 700 has the same as 770 or 777 if the owner is the one accessing the files.

The notation that starts with a 0 is used in PHP, not in Linux. It signals to PHP that the number is written in octal.

If you are lost you might need to ask your web hosting for help.

Thank you!

I simply ask you for a direct answer, taking into account that I don’t have to worry about owned and group because shared hosting takes care of it by default.

I want to set by default dir_mode to 775, can you tell me if I have to write 02775 or 0775 or 775?
file_mode instead I leave 0755 or do I put 755?

Thanks again!

This should work, but it will only apply to some newly created files:

‘default_permissions’ => array(
‘dir_mode’ => 02775,
‘file_mode’ => 0755,
‘chown’ => ‘’,
‘chgrp’ => ‘’,
),

That array in config.php is not the critical thing about “setting permissions” for SuiteCRM. What is more critical is the commands given from the console to set the all the files correctly.

I am not confident there is “simple direct answer” because the information you have given previously is not sounding consistent to me. If your files were owned by the correct user, all those numbers starting with 7 would mean the same, and you wouldn’t have a bunch of undefineds all over the app.

Remember to run a QR&R between each time you change anything.

For anyone else coming here - my advice is to never use a hosting that does not provide console access. It makes administering SuiteCRM a pain in the *** and it’s really not necessary. You can find affordable hostings that provide some SSH access.

The new installation with the above changes in include/utils.php appears to be OK! I don’t experience any “undefinied” issues, compared to when I hadn’t changed the file.

The latest clarifications:

  1. now in the cache folders there are directorys with permissions 0775 and 02775, sure that 02775 is equally good or shouldn’t put 0775 directly?

  2. When you do Quick Repair and Rebuild? When you recommend doing it? When do you make changes with Studio for example? And when too?

  3. Also:

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

Do you reapply them periodically? When do you do what kind of changes?

  1. Last thing, can you confirm with certainty that even if I don’t have SSH access, with FileZilla, can I manage everything well even if I am in shared hosting? After all, the permissions I had to apply via SSH, did I manage to apply them via FileZilla or do you think it is not the same thing? This doubt haunts me!

  2. In Admin > Schedulers I see

*    *    *    *    *     cd /home/myusername/public_html/crm; php -f cron.php > /dev/null 2>&1

But seems that work only with this line:

*    *    *    *    *     cd cd /home/myusername/public_html/crm; /usr/local/cpanel/3rdparty/bin/php -f cron.php

Do you think that my last line in the best syntax for shared hosting?

Thanks, with this I think I have clear ideas to start working with SuiteCRM!

  1. That “2” is for directories (SetUID + SetGID bits), the numbers without the 2 are for files. You can find plenty of information online about Linux permissions.

  2. Only when you feel the need. When, after changing something structural (some things in Studio, but not all), you don’t get the expected results.

  3. I don’t reapply permissions, if a permissions system is well tuned, it takes care of itself and is stable.

  4. I always recommend console access for administration. I would never run or administer a SuiteCRM that doesn’t give me SSH access. It is possible, but it is a needless nuisance. I don’t know how FileZilla applies permissions, so I can’t comment on that. Typically these FTP programs only apply one directory at a time, no recursion, so in order to set everything you would need to go into each directory individually, it would take hours.

  5. There is no generic answer for “shared hosting”, they vary considerably. If you have a line that works, cool. It is normal to add the full PHP path when needed, like you added in your second case.

Great! Thanks a lot!

So:

  1. Do you advise me to set 02775 or 0775?

  2. OK. Yes, FileZilla apply permission “recursive”

02755 for directories, 755 for files. If this is confusing, or not an option in the FileZilla UI, I would advise you to forget about this unless you have some problem in the app.

The directories bits are probably already set correctly.

If this had a problem, you would be seeing undefineds due to the cache directory. You can also check if you can upload a file in Notes or Documents modules, and then retrieve it correctly. If you can, then the upload directory is ok too.

Everything works fine now, I simply ask you, if in include/utils.php I have to read ‘dir_mode’ => 02775 or ‘dir_mode’ => 0775, this is what I am interested in clarifying.

Thanks!

I feel like I’ve answered that already - twice. Scroll up, it’s there :slight_smile:

I don’t want to argue but here you tell me Install SuiteCRM 7.11.15 on a shared hosting dir_mode 02775

Here Install SuiteCRM 7.11.15 on a shared hosting dir_mode 2755

What confuses me, can you be explicit for the last time?

Thanks a lot!

No, actually — sorry if this still confuses people

I explained above that the 0 is PHP notation for octal. So you put the zero everytime you’re specifying octal in a PHP array, as is the case in config.php. When you use the numbers in the Linux command-line, the zero is not necessary (and should not be used).

I hope this makes things clearer.

1 Like

Yes, thanks, now all seems clear!