I had a nightmare with file permissions with Cpanel.  The problem was i was unable to upload file in cpanel plus i couldnt install a theme or plugin in wordpress. I could not even upload a image in wordpress.

I got unable to create directory problem thrown with wordpress.. It took hours to properly fix this problem. First look the error logs to see what the problem is..

tail /usr/local/cpanel/logs/error_log

Here are the basic things you should know about fixing permissions

  • First your public_html folder should have 750 permission
  • All folders under that should have 755 permission
  • All files under that should have 64 permission
  • The ownership should be user:user and for public_html user:nobody

Accordingly issue the following

To change all file permissions to 644, run

 find /home/user/public_html -type f -exec chmod 644 {} +

To change all folder permissions to 755, run

find /home/bestcitizenships/public_html -type d -exec chmod 755 {} +

To set permissions for only public_html folder

chown bestcitizenships:nobody  /home/user/public_html/

Thats it! Restart apache

It solved my problem.