open_basedir error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alvaro G Vicario

    open_basedir error

    This is the open_basedir restriction of my site:

    php_admin_value open_basedir /tmp/:/home/site/

    All my PHP files are under /home/site/htdocs. However, I get lots of errors
    like:

    Warning: open_basedir restriction in effect. File is in wrong directory in
    /home/site/.......

    I'm 100% sure it's related to open_basedir because disabling it solves the
    problem. The funniest thing is:

    # Excerpt from /home/site/htdocs/lib/inc/foo.php
    include_once('f ile.inc.php'); # Error unless no open_basedir
    include_once('/home/site/htdocs/lib/inc/file.inc.php'); # Works fine

    I'm including exactly the same file in the same location so paths are
    correct! I added "." to open_basedir but didn't work.

    Why???

    Thank you in advance,

    --
    -- Álvaro G. Vicario - Burgos, Spain
    -- Questions sent to my mailbox will be billed ;-)
    --
  • Pjotr Wedersteers

    #2
    Re: open_basedir error

    Alvaro G Vicario wrote:[color=blue]
    > This is the open_basedir restriction of my site:
    >
    > php_admin_value open_basedir /tmp/:/home/site/
    >[/color]
    Is your open_basedir /home/site ot /tmp/:home/site ???
    The first would be logical to me, the second I don't understand.
    I have specified my open_base_dir in my php.ini as /base/ (part of a
    chrooted environment).
    Works without a hassle.

    Pjotr


    Comment

    • Alvaro G Vicario

      #3
      Re: open_basedir error

      *** Pjotr Wedersteers wrote/escribió (Wed, 1 Sep 2004 16:02:37 +0200):[color=blue]
      > Is your open_basedir /home/site ot /tmp/:home/site ???
      > The first would be logical to me, the second I don't understand.
      > I have specified my open_base_dir in my php.ini as /base/ (part of a
      > chrooted environment).[/color]

      It's /tmp/:home/site. I don't want users to complain when they're using
      scripts that rely on system's default temporary directory.


      --
      -- Álvaro G. Vicario - Burgos, Spain
      -- Questions sent to my mailbox will be billed ;-)
      --

      Comment

      • Alvaro G Vicario

        #4
        [Solution] Re: open_basedir error (was: open_basedir error)

        *** Alvaro G Vicario wrote/escribió (Wed, 1 Sep 2004 13:51:36 +0200):[color=blue]
        > php_admin_value open_basedir /tmp/:/home/site/
        >
        > All my PHP files are under /home/site/htdocs. However, I get lots of errors
        > like:
        >
        > Warning: open_basedir restriction in effect. File is in wrong directory in
        > /home/site/.......[/color]

        It happened that 'include_path' contained /usr/share/pear/. Whatever the
        reason, include_once() tried to search for the file there when I provided a
        relative path, thus the warning. Weird thin is that it didn't happen *every
        time* I used relative paths...

        Solution:

        /tmp/:/home/site/:/usr/share/pear/

        --
        -- Álvaro G. Vicario - Burgos, Spain
        -- Questions sent to my mailbox will be billed ;-)
        --

        Comment

        Working...