Understanding the correct permissions for your hosting files and directories is crucial for the security and functionality of your website. This guide will help you set the right permissions for your files and directories in cPanel.
Files should always be uploaded and set to chmod 644. However, there are a few important exceptions:
When you upload files using cPanel File Manager, those files will be set to chmod 644 automatically. Unless your FTP software has been specially configured to set uploaded files to different permissions, then newly uploaded files will also be set to chmod 644 automatically.
Directories should always be uploaded and set to chmod 755.
When you upload files using cPanel File Manager, directories will be set to chmod 755 automatically. Unless your FTP software has been specially configured to upload directories with different permissions, then newly created directories will also be set to chmod 755 automatically.
Software developers often prioritize making their software work over the security of your website. You might be told that directories should be chmod 777 or even that files need to be chmod 755, but if you are just talking about a PHP-based website, then PHP files will operate just fine chmod 600 or chmod 644.
The reason for this is that LiteSpeed serves PHP files via the suEXEC CGI. This means that PHP files are served under your cPanel username's security context. And because your username owns your web files, you only have to grant Read and Write permissions to the owner (thus, chmod 600).
If in doubt, and you want your site to be as secure as possible, please log a support ticket via your Brixly Client Area. We're here to help!