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!

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:
    51
    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,561
    Likes Received:
    42
    Trophy Points:
    308
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. mickbeng

    mickbeng Well-Known Member

    Joined:
    Oct 3, 2006
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    156
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,216
    Likes Received:
    10
    Trophy Points:
    313
    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

  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