Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

SOLVED PHP public_html permissons

Discussion in 'Security' started by mreidgs, Nov 7, 2017.

  1. mreidgs

    mreidgs Member

    Joined:
    Nov 7, 2017
    Messages:
    12
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Calgary
    cPanel Access Level:
    Root Administrator
    It seems like PHP does not have write permissions to account public_html directories by default.

    I create an account from within WHM, upload an importbuddy.php backup to restore the site on the server. I get:

    Error #224834 . This directory, `/home/cmitest/public_html/`, is not write enabled according to the server. Please verify proper write permissions to continue. If this persists, contact your web hosting provider and tell them that is_writable("/home/cmitest/public_html/") returns FALSE in PHP.

    I have to manually change the permissions to 755 on public_html for it to work, then change it back again after. This didn't used to be the case, only started happening recently.

    Running CENTOS 6.9 virtuozzo, WHM v68.0.9
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,442
    Likes Received:
    1,961
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    Check to see if "Enable File Protect" is enabled under the "Security" tab in "WHM >> Tweak Settings". The File Protect functionality will check the permissions and ownership values on each user account's home and public_html directories and each addon domain's DocumentRoot directory and then set the values accordingly. Note that rather than disabling this option, you may want to consider switching to a different PHP handler:

    PHP Handlers - EasyApache 4 - cPanel Documentation

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. quizknows

    quizknows Well-Known Member

    Joined:
    Oct 20, 2009
    Messages:
    1,011
    Likes Received:
    89
    Trophy Points:
    78
    cPanel Access Level:
    DataCenter Provider
    If you run multiple sites on a server, for security reasons you should ALWAYS use file protect, and public_html itself should be 750. Never should you set public_html itself as 755. Check your php handling, apache MPM, etc as necessary to make it work.
     
    cPanelMichael likes this.
  4. mreidgs

    mreidgs Member

    Joined:
    Nov 7, 2017
    Messages:
    12
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Calgary
    cPanel Access Level:
    Root Administrator
    The only option I have for PHP handler is PHP or none.

    Default PHP is set to: ea-php56
     
  5. mreidgs

    mreidgs Member

    Joined:
    Nov 7, 2017
    Messages:
    12
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Calgary
    cPanel Access Level:
    Root Administrator
    System PHP-FPM Status: Off

    Should I turn this on?
     
  6. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,442
    Likes Received:
    1,961
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    Are you checking from within Web Host Manager? The "PHP Handlers" tab is found within the "WHM >> MultiPHP Manager" option. You can read about each PHP handler at:

    PHP Handlers - EasyApache 4 - cPanel Documentation

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. mreidgs

    mreidgs Member

    Joined:
    Nov 7, 2017
    Messages:
    12
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Calgary
    cPanel Access Level:
    Root Administrator
    Here's a screenshot
     

    Attached Files:

  8. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,442
    Likes Received:
    1,961
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    It looks like it's CGI that's available. You can install additional handlers using "WHM >> Software >> EasyApache 4" if you want to use a different handler. That said, check out the section on CGI for information on how PHP scripts are executed when it's enabled:

    PHP Handlers - EasyApache 4 - cPanel Documentation

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. mreidgs

    mreidgs Member

    Joined:
    Nov 7, 2017
    Messages:
    12
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Calgary
    cPanel Access Level:
    Root Administrator
    There are some differences between the 2 servers I have, both are with GoDaddy.

    One is the latest version of cpanel, but hasn't been migrated to EasyApache4, I ran the migration last week but I broke some Wordpress sites so I had to revert back. It has the option for configure php and suexec. The php handler is set to suphp and suexec is set to on.

    The other server is cpanel version 66.0.29, but has been migrated to EasyApache4, so it has the Multiphp option. The only option I have for php handler there is cgi.
     
  10. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,442
    Likes Received:
    1,961
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    You can install additional handlers such as suPHP using "WHM >> Software >> EasyApache 4". The "mod_suphp" package is found under the "Apache Modules" section.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. mreidgs

    mreidgs Member

    Joined:
    Nov 7, 2017
    Messages:
    12
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Calgary
    cPanel Access Level:
    Root Administrator
    Ok, that seems to have solved the issue.

    Thanks!
     
    quizknows and cPanelMichael like this.
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice