The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

php creates files with owner 'nobody'

Discussion in 'General Discussion' started by guysmiley, Sep 9, 2008.

  1. guysmiley

    guysmiley Member

    Joined:
    Sep 6, 2008
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    Greetings,

    Using Joomla, when I create a folder, it has owner=nobody. I presume since php is being invoked to make this folder, it is php assigning 'nobody' as the owner.

    Why would php be doing this?
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    This is the default behavior of PHP.

    If you prefer that scripts run as the user and files created by these scripts be owned by the user, I recommend running SuPHP (or if you're running PHP as CGI, SuExec).
     
  3. mambovince

    mambovince Well-Known Member

    Joined:
    Jan 15, 2005
    Messages:
    192
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    London, UK
    I am running PHP as CGI with SuExec on one server.
    Noticed load shows high now for PHP5.

    - Would SuPHP lower the load?

    - Any 'gotchas' to look out for if I change to SuPHP?

    Many thanks,

    - Vince
     
  4. mambovince

    mambovince Well-Known Member

    Joined:
    Jan 15, 2005
    Messages:
    192
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    London, UK
    Anyone?
    Also, would you run SuPHP if you're running PHP as CGI or Apache mod, with/without SuExec? :confused:

    Many thanks,

    - Vince
     
  5. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    I am unsure about loads, but SuPHP is used when PHP is not running as CGI/FastCGI. When PHP is running as CGI/FastCGI, SuExec is used instead as that targets CGI apps.

    You wont have an instance where a single PHP installation is running under SuExec and SuPHP simultaneously.
     
  6. mambovince

    mambovince Well-Known Member

    Joined:
    Jan 15, 2005
    Messages:
    192
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    London, UK
    Thanks David,
    So I cannot run SuPHP on this server then, because it has concurrent PHP4/5 with PHP4 running as Apache MOD?

    Lastly, any 'gotchas' to look out for if I change to SuPHP?
    'm worried about existing client sites that need 777 permissions on some directories.

    Thanks again,

    - Vince
     
  7. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    I believe you misunderstood my statement. If you run PHP as an Apache module, you can use SuPHP. If you run PHP as any form of CGI, you cannot use SuPHP, and must use SuExec instead as SuExec handles this functionality for CGI applications.

    SuPHP does not permit excessive permissions such as 777 as they are not required in a SuPHP environment. Scripts with 777 permissions or including files with 777 permissions will generate a HTTP 500 error once SuPHP is running.

    Note, any applications that rely on 777 permissions typically mean that whatever user PHP is running as must be able to read, write and execute the file. In a mod_PHP environment, xx7 permissions are required as PHP is running as user nobody. However, when SuPHP is running, you can use 755 permissions or lower without issue since PHP is now running as that individual user.

    Most modern PHP scripts will easily accommodate SuPHP setups. Generally it's only scripts that are unaware of common contemporary PHP security practices that blindly insist on and inappropriately enforce 777 permissions.
     
  8. mambovince

    mambovince Well-Known Member

    Joined:
    Jan 15, 2005
    Messages:
    192
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    London, UK
    Thanks for the comprehensive reply, I'm sure it will help others as well as myself.

    Lastly, if I use EasyApache to recompile with SuPHP, does it also check and change all directories and files with 777 and change them to 755?

    If not, is there another script to do this?

    Best wishes,

    - Vince
     
  9. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page