Skip to main content

How to reset permissions on hosting account files

Comments

8 comments

  • rpvw
    Here is how I usually correct all permissions for a site (as root). (You may need to ask the server administrator to do this for you if your Reseller shell access doesn't have enough privileges) find /home//public_html/ -type f -exec chmod 644 {} \; find /home//public_html/* -type d -exec chmod 755 {} \;
    Replace with the actual account username. If your Add-On domain is being served from another folder, or from outside of /public_html, you should modify the folder paths as necessary. You can also change the file and folder permissions from the File Manager in the users cPanel. See
    0
  • DennisMidjord
    While the above is usually fine, some files and folders sometimes needs other permissions.
    0
  • maestroc
    I gave those commands a try. Sadly I still get the Could not create directory error. Could it be ownership somehow? /Public_html is username:nobody but all files and folders inside the public_html have been set as username:username recursively. drwxr-xr-x 9 username username 4096 Sep 9 19:46 sitename.com and inside that folder as an example: -rw-r--r-- 1 username username 3340 May 22 23:39 wp-config.php drwxr-xr-x 7 username username 4096 Aug 9 2017 wp-content -rw-r--r-- 1 username username 3669 May 11 03:24 wp-cron.php -rw-r--r-- 1 username username 246 Jul 29 2014 wp-feed.php drwxr-xr-x 18 username username 12288 May 11 03:25 wp-includescd if I dig deeper into those folders the permissions and ownership seem to be correct. Is there anything else I should try?
    0
  • cPanelLauren
    Hi @maestroc What's the error you're getting specifically - this would most likely show up in the PHP logs (if enabled) from the domain's docroot Thanks!
    0
  • maestroc
    Hi @maestroc What's the error you're getting specifically - this would most likely show up in the PHP logs (if enabled) from the domain's docroot Thanks!

    The error_log file is there but it hasn't been updated since around the time this problem started happening. My guess is that the error_log for that folder cannot be written to even though it is set to 0644 and username:username If I force an error by trying to install a new plugin it does not append anything to the error file. The last lines in the file are from a year ago (yes this site does not get new content very often). Those lines are pasted below but I don't think they are applicable to this. No idea though... [01-Sep-2017 08:07:55 UTC] PHP Warning: Illegal string offset 'choice_new' in /home/xxxx/public_html/vx/wp-content/themes/wp_olympic5-v1.0.1/functions.php on line 308 [01-Sep-2017 08:07:55 UTC] PHP Warning: Illegal string offset 'placeholder' in /home/xxxx/public_html/vx/wp-content/themes/wp_olympic5-v1.0.1/functions.php on line 309 [01-Sep-2017 08:07:55 UTC] PHP Warning: Illegal string offset 'section_id' in /home/xxxx/public_html/vx/wp-content/themes/wp_olympic5-v1.0.1/functions.php on line 310 [01-Sep-2017 08:07:55 UTC] PHP Warning: Illegal string offset 'option_group' in /home/xxxx/public_html/vx/wp-content/themes/wp_olympic5-v1.0.1/functions.php on line 313
    0
  • maestroc
    I hate to do this: You may want to review
    0
  • cPanelLauren
    Thank @maestroc for posting the errors you were receiving as you can see they helped a lot! I'm glad you were able to get the issue fixed. @rpvw thanks for the sound advice!
    0

Please sign in to leave a comment.