Fix Ownership and Permissions¶
Most of CS-Cart files should have the 644 permissions, and all directories must be set to 755. When you using CS-Cart, the var
, images
, and design
directories, and all their subdirectories and files should have the 777 permissions. This is required to allow CS-Cart to upload files to these directories for routine operations.
CS-Cart permission fixer¶
For clients of our hosting, we provide the tool cscart_perms_fixer. Just call command via command line (SSH), select project and push “Enter”. Fixed :)
root@highloadtest public_html> cscart_perms_fixer
We found cs-cart in directories:
1. /srv/projects/highloadtest.demo.scalesta.com/public_html
Please input the number of the CS-Cart project and press Enter:
1
Fixing all file permissions ...
Complete.
Manual mode¶
Step 1: Permissions¶
Execute the following commands one by one:
chmod 644 config.local.php
chmod -R 755 design images var
find design -type f -print0 | xargs -0 chmod 644
find images -type f -print0 | xargs -0 chmod 644
find var -type f -print0 | xargs -0 chmod 644
These commands set the right permissions for the files, so that CS-Cart can install properly. The 3 digits represent the rights of the owner of the file/directory, the owner’s group, and other users respectively.
For example, chmod 644 config.local.php
means that: - The owner of config.local.php
can read the file and write to it(6). - The group to which owner belongs (e.g. administrators) can read the file (4). - All other users can also read the file (4).
Step 2: Ownership¶
Set the service user as the owner of your CS-Cart files. We provide user service, and its group is service as well. In this case, this is the command you need to use:
chown -R service:service .
Also, if you need help with it, you can contact us via Scalesta system.
Hint
If you have a problem, need assistance with tweaks or a free consultation, if you just want to discuss your project with experts and estimate the outcome, if you're looking for a solution that reinforces your online business, we will help. Let us know through Scalesta account or email.