Set file Permission Automatically Suphp or fastcgi

———————————————————————————————–
cd /public_html

directory
find . -type d -exec chmod g+ws {} ;

files 
find . -type f -exec chmod 664 {} ;
———————————————————————————————–

———————————————————————————————–

You can use the following two lines to reset your permissions. Note that the default directory permissions are 755 and the default file permissions are 644, so that is what I will show here, however, if your webhost says you need other permissions for something, then you can change the numbers. Beware of 777 permissions though, as they are a security threat! If you are told to use 777, first try it with 755 and 644, if that doesn’t work, then carefully add 777 permissions only where you need it.

Here are the SSH commands to fix your permissions on a mass level:

find ~/public_html -type d -exec chmod 755 {} ;
find ~/public_html -type f -exec chmod 644 {} ;
———————————————————————————————–

Leave a Reply

Your email address will not be published. Required fields are marked *