Fixing files and folders permissions on your host account  Print this Article

Some users can face permissions problems with the hosting account service.
After you published aplications and you get messages like "500 Internal Server Error" or when trying to creating the connection on scriptcase deploy environment you get an error like this "failed to open stream: Permission denied in..."

The first thing that some people say is to give 0777 permission. The first "7" is the total permission for the owner, the second one is for the group and the third "7" is for everyone. Here is the trick, for hosts company, a permission 0777 is a security issue for php files. "Everyone" can't have total permission. So you cant an internal server error.

The correct permissions are:

Folders: 0755
Files: 0644

So, how to fix? 

1. Open a shell (or putty on windows) and log in into your SSH account;
(if you don't know how do this, just follow this tutorial:

2. Execute the command to solve these problems at your public_html(www) folder:

find /home/$(whoami)/public_html/ -type d -exec chmod 755 {} \; && find /home/$(whoami)/public_html/ -type f -exec chmod 644 {} \; && find /home/$(whoami)/public_html/ -name wkhtmltopdf* -exec chmod 755 {} \; && find /home/$(whoami)/public_html/ -name phantomjs* -exec chmod 755 {} \; && find /home/$(whoami)/public_html/ -name zend* -exec chmod 755 {} \;

If you need to change permissions in another directory like a addon domain directory, just replace every public_html is this command by the directory name you want.

Was this answer helpful?

Also Read

php error: Allowed memory size of x bytes exhausted
If you are getting an error like "Allowed memory size of... in file...
How to create a user-friendly URL using .htaccess?
If your website is using long URL like, you can change it...
How to redirect a site from http to https using .htaccess
First you need to create a .htaccess file on your host.After you need to use the rules below:...
How to redirect a page to another page or website using .htaccess?
If a page on your website no longer exist and you want to redirect it to your new page or website...