How to fix CPanel Server Error due to file permissions

I’ve run into a problem a couple times that maybe you have seen too.  After uploading a website that is maintained by a CPanel backend, you run into a “403 Forbidden” and “500 Internal Server Error” problems.

Unfortunately, a CPanel installation is not usually helpful in this matter. It turns out, the problem is usually simple to solve. Usually, these errors are caused by security settings that are default in CPanel. They ensure that other accounts on the system are not able to mess with your files.

The fix

To fix the problem, open up a terminal window and run the following code (replace your webroot directory as needed):

find /path/to/base/dir -type d -print0 | xargs -0 chmod 755 
find /path/to/base/dir -type f -print0 | xargs -0 chmod 644

That’s it. Problem solved. Go load your website and enjoy the permission error free experience.

Leave a Reply