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.

Opening fiiles outside of user directory

Discussion in 'General Discussion' started by pdaddy, Feb 1, 2010.

  1. pdaddy

    pdaddy Registered

    Joined:
    Feb 1, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I've just migrated from one Cpanel server to another.

    On my old server, I often used php to require and include files outside of the current domain's user directory. This was handy for calling in database variables from other domains in order to link different databases together.

    However I no longer have permission to do this on my new server. Fopen etc. fails unless the target file is chowned to the UID of the domain trying to access it, which is no good.

    PHP's basedir_protection is definitely not turned on, and neither is PHP safemode. I presumre the ability to open files outside of the current user directory is an apache directive somewhere, but I have no idea where.

    Security worries aside, anyone know how I can fix this? Thanks!
     
  2. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    I believe this is a security provision of suPHP. You'll either need to adjust the parameters of suPHP, change the PHP handler to a less-security conscious one ( e.g. DSO ) or change the ownership and permissions of the files you are trying to open.
     
  3. mickbeng

    mickbeng Well-Known Member

    Joined:
    Oct 3, 2006
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Penang, Malaysia
    Perhaps, you may check for the error_log for more detail and I will not suggest for DSO if you have suPHP turned on.
     
  4. 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
    Also, be mindful that SuPHP and SuExec is enabled by default on new cPanel/WHM servers. This is a relatively recent change in product defaults.
     
Loading...

Share This Page