For both security and functionality, it's very important to set the right permissions for the files and folders on your website. This guide tells you what permissions to use in cPanel.
Set default files to chmod 644.
Sensitive PHP files (e.g., wp-config.php) containing database login info should be chmod 600. All PHP web scripts should also be chmod 600. PHP interprets these files, so they don't need the execute bit.
Scripts run from the shell or crontab with a shebang (PHP, Perl, Python) should be chmod 700.
CGI scripts in cgi-bin or similar folders: chmod 700.
.htaccess files: Default chmod 644, but for better security use chmod 444 (read-only).
Files uploaded via cPanel File Manager are automatically set to
chmod 644. FTP uploads usually follow the same default unless configured differently.
Set directories to chmod 755.
Directories uploaded via cPanel File Manager automatically get
chmod 755. FTP uploads follow this default unless changed.
Some PHP programs suggest chmod 777 for files or folders. This isn’t needed for PHP websites running on LiteSpeed with suEXEC CGI. Your cPanel username owns the files, so chmod 600 or chmod 644 works perfectly. Only the owner needs read/write access.
Tip: If you’re unsure or want to make your website as secure as possible, contact the Cyberin support team. We can help!