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 Script error?

Discussion in 'General Discussion' started by djoverho, Jan 3, 2004.

  1. djoverho

    djoverho Active Member

    Joined:
    Feb 19, 2002
    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    WV
    Hi, we have a user that was recently moved to another server and is getting this message when trying to go to their index page:

    Warning: Unknown(): open_basedir restriction in effect. File(/home/XXXest/public_html/index.php) is not within the allowed path(s): (/home/xxxest:/usr/lib/php:/usr/local/lib/php:/tmp) in Unknown on line 0

    Warning: Unknown(/home/XXXest/public_html/index.php): failed to open stream: Operation not permitted in Unknown on line 0

    Warning: (null)(): Failed opening '/home/XXXest/public_html/index.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in Unknown on line 0

    Any ideas on this one...no one else is having a problem (the username is fake but its the same format) I thought maybe that it was because some of the letters in the username were capital and others were not. We appreciate anyone help or ideas...thanks
     
  2. euselect

    euselect Well-Known Member

    Joined:
    Aug 3, 2003
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    Hello

    It sounds like the files are not owned by the correct user.
    Make sure the websites permissions are correct.

    Did you do a cpanel copy or another method to move the site ?

    Neil
     
  3. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
    You've got the open_basedir security tweak enabled. The account you're getting errors on is probably disabled. Either enable it or disable it for all accounts and the error should go away.
     
  4. djoverho

    djoverho Active Member

    Joined:
    Feb 19, 2002
    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    WV
    Excellent!!! Thanks, that worked Casey. Is that option something that a security function that I should leave on or just disable for the ones that are having a problem like that? Thanks again for the quick responses and info.
     
  5. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
    It's a security function. I enable it for all accounts on my servers. If somebody needs access to more directories you can add them in manually in httpd.conf. But like I said, if you're going to enable the restriction on one account you have to enable it on all accounts or there will be trouble.
     
  6. djoverho

    djoverho Active Member

    Joined:
    Feb 19, 2002
    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    WV
    So, if I just unchecked the box for the one domain in php open_basedir Tweak and left all of the others checked, that is bad? As far as adding them httpd.conf, I was looking at it but I'm not exactly sure where something like that would go and what the syntax would be. Would you mind explaining that a little more for me? Thanks again.
     
  7. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
    If you put a check in the box beside "Enable php open_basedir Protection" you will enable the restriction (prevent users from accessing files outside their own directories with php).

    If you then put a check beside a username, that username will be excluded from the restriction (they will be able to access files that do not belong to them via php).

    It has been my experience that if you enable the restriction but then disable it for certain users, those users will have problems.

    The restriction adds the following code to httpd.conf:
    Code:
    <IfModule mod_php4.c>
    php_admin_value open_basedir "/home/USERNAME:/usr/lib/php:/usr/local/lib/php:/tmp"
    </IfModule>
    If a certain user needs another directory added, let's say /var, then you would edit the above to read
    Code:
    <IfModule mod_php4.c>
    php_admin_value open_basedir "/home/USERNAME:/usr/lib/php:/usr/local/lib/php:/tmp:/var"
    </IfModule>
    and you can just keep adding directories as needed separating them with colons.

    So my suggestion is to check the box beside "Enable php open_basedir Protection" and leave all other boxes unchecked.
     
    #7 casey, Jan 3, 2004
    Last edited: Jan 3, 2004
  8. djoverho

    djoverho Active Member

    Joined:
    Feb 19, 2002
    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    WV
    Ok...thanks again for your advice Casey, we appreciate it.
     
Loading...

Share This Page