CHMOD folders, sub-folders, sub-sub-folders, and so on

If you recently changed your PHP handler to suPHP from mod_php or DSO, then you need to CHMOD all your folders, its sub-folders, sub-sub-folders, and so on to 744 to avoid any internal server errors, specifically internal server 500 errors.

And also, you need to CHMOD all of your files to 644.

In order to do this automatically, login as root in your server and go to your home directory, then enter this command via SSH.

For folders:
find {path to the folder} -type d -exec chmod 755 {} \\;

For files:
find {path to the folder} -type f -exec chmod 644 {} \\;

And that’s it! It will change the permissions of all your files and folders under your home directory automatically! It’s like magic!

Do you love this article and you want to receive more interesting posts from Bryan Veloso? Why not subscribe to this blog via e-mail? It's easy! Just enter your e-mail address below and confirm your subscription by clicking the activation link that will be sent to your e-mail! Get your free subscription now!

Enter your email address:

This entry was posted in Geekery and tagged . Bookmark the permalink.

2 Responses to CHMOD folders, sub-folders, sub-sub-folders, and so on

  1. Steve says:

    Thanks for the hint 😉

    but I got a error saying find: missing argument to `-exec’
    so I solved it using this command: find -type d -exec chmod 755 {} \;

Leave a Reply

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