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!

File permissions wont stay when set by cPanel

Discussion in 'General Discussion' started by durangod, Jan 30, 2018.

  1. durangod

    durangod Well-Known Member

    Joined:
    May 12, 2012
    Messages:
    365
    Likes Received:
    17
    Trophy Points:
    68
    cPanel Access Level:
    Root Administrator
    Hi,

    I noticed today after getting some new errors (just updated cpanel yesterday) that some of my files in my domain that require to be 777 were set to 644. So i changed them via cpanel to 0777. I still got the errors as before..

    So then i noticed that the files had reverted back to 0644 when the system rewote the cache files. Then i changed them to 0777 using filezilla and they stayed the same, but then when the system rewrote the cache file again it wrote it back as 0644.

    I use the same owner of the files on both filezilla and cpanel so whats the difference.

    Why is the system writing files 0644 autmatically? And why cant it see that i want these files at 0777 permanently?

    Thanks :)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. rpvw

    rpvw Well-Known Member

    Joined:
    Jul 18, 2013
    Messages:
    666
    Likes Received:
    221
    Trophy Points:
    43
    Location:
    Spain
    cPanel Access Level:
    Root Administrator
    Check to see if you have Tweak Settings > Security > File protect switched on.
    My understanding is that this setting (ON by default) will reset all the permissions in the public_html folder each time upcp runs.

    You might want to experiment with switching this OFF, but I would strongly advise against setting any 0777 file permissions in the first place.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. durangod

    durangod Well-Known Member

    Joined:
    May 12, 2012
    Messages:
    365
    Likes Received:
    17
    Trophy Points:
    68
    cPanel Access Level:
    Root Administrator
    hi thanks i will check it out.. i know that the owner is root and that i am running php as cpanel username and that i am running fastcgi if all that matters. The script requires that cache files be 0777 so thats the only reason why.

    I really wish i could get off of fastcgi i want for apache to handle my php files as im used to that but i remember when i set this up that there were so many options and i remember that i got so lost in all of it i just gave up and set it to fastcgi just to get the server up.

    I currently have this account set up as a reseller but i really dont need that on this account as im on the main shared ip so ill take the reseller off. That will at least eliminate the confusion of having whm on the domain level. Then i can controll it from root whm.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. durangod

    durangod Well-Known Member

    Joined:
    May 12, 2012
    Messages:
    365
    Likes Received:
    17
    Trophy Points:
    68
    cPanel Access Level:
    Root Administrator
    I changed that setting to NO and still the same :(
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. durangod

    durangod Well-Known Member

    Joined:
    May 12, 2012
    Messages:
    365
    Likes Received:
    17
    Trophy Points:
    68
    cPanel Access Level:
    Root Administrator
    Removing fastgci of course broke the website. Is there a guide how to do this correct and get back to basics (apache php)

    UPDATE: I was able to get the php running as cpanel owner by uninstalling fastcgi and then leaving cgi as the handler in easyapache.

    I checked it this way

    Code:
    <?php
    echo "<pre>";
    $userinfo = posix_getuid();
    $finaluserinfo = posix_getpwuid($userinfo);
    print_r($finaluserinfo);
    exit;
    
    now both php user and file owner are the cpanel username which is good..

    but phpinfo still says fastcgi, what the heck? And the same problem with permissions.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #5 durangod, Jan 30, 2018
    Last edited: Jan 30, 2018
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,660
    Likes Received:
    1,787
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Do you have any cron jobs installed as part of that script (or elsewhere) that could be automatically altering the permissions of the files in that directory?

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

    durangod Well-Known Member

    Joined:
    May 12, 2012
    Messages:
    365
    Likes Received:
    17
    Trophy Points:
    68
    cPanel Access Level:
    Root Administrator
    that is very possible, i will check that out... thanks :)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
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