open_basedir: allowed path not recognized

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Markus

    open_basedir: allowed path not recognized

    Hi

    My ISP seems to have made a PHP version upgrade - without any change in
    the code, a new error occurs:

    PHP Warning: ftp_nlist() [function.ftp-nlist]: open_basedir restriction
    in effect. File(/var/tmp/) is not within the allowed path(s):
    (/data/htdocs/domain.com/:/usr/local/share/pear/:/tmp/:/var/tmp/) in ...

    I have found some bugs related to open_basedir and temp directory
    creation, they have all been set to Bogus, as /tmp/ should be added to
    the allowed paths. Others are about trailing slashes that do not match.

    But what looks special and disturbing to me in my example: The required
    path does actually match an allowed paths entry:

    - File(/var/tmp/)
    - allowed path(s):
    (/data/htdocs/domain.com/:/usr/local/share/pear/:/tmp/:/var/tmp/)

    So, what could I be missing? Both temporary directory and open_basedir
    seem to be properly set. Could this be a disturbing between the PHP and
    FTP users, which have different base directories? Or is it related to
    the trailing slash problem?

    Does anybody know a way how to work around this? I am grateful for any hint!

    Markus
  • Markus

    #2
    Re: open_basedir: allowed path not recognized

    Markus schrieb:
    Hi
    >
    My ISP seems to have made a PHP version upgrade - without any change in
    the code, a new error occurs:
    >
    PHP Warning: ftp_nlist() [function.ftp-nlist]: open_basedir restriction
    in effect. File(/var/tmp/) is not within the allowed path(s):
    (/data/htdocs/domain.com/:/usr/local/share/pear/:/tmp/:/var/tmp/) in ...
    >
    I have found some bugs related to open_basedir and temp directory
    creation, they have all been set to Bogus, as /tmp/ should be added to
    the allowed paths. Others are about trailing slashes that do not match.
    >
    But what looks special and disturbing to me in my example: The required
    path does actually match an allowed paths entry:
    >
    - File(/var/tmp/)
    - allowed path(s):
    (/data/htdocs/domain.com/:/usr/local/share/pear/:/tmp/:/var/tmp/)
    Strange enough: Setting a temporary directory with putenv() does not
    change anything, ftp_nlist() still tries to use /var/temp/ as temporary
    directory.

    putenv('TMPDIR= '.$_SERVER['DOCUMENT_ROOT'].'/temp/');
    var_dump(getenv ('TMPDIR')); // prints the path
    $list = ftp_nlist($conn _id, '/');

    Resulting message is still:
    PHP Warning: ftp_nlist() [function.ftp-nlist]: open_basedir restriction
    in effect. File(/var/tmp/) is not within the allowed path(s) ...

    I tried to replace ftp_nlist() by something like:

    ftp_raw($conn_i d, 'PASV');
    ftp_raw($conn_i d, 'TYPE A');
    $liste = ftp_raw($conn_i d, 'NLST');
    var_dump($liste ); exit;

    This blocks the system for several minutes, then displays an empty array.

    Comment

    Working...