open_basedir restriction although it's set correctly

Discussion in 'PHP' started by fanatique, Jan 5, 2006.

  1. #1
    hello everybody,

    i've got a problem that drives me nuts. trying to exceute
    mkdir()
    PHP:
    returns the following error message:
    Warning: mkdir(): open_basedir restriction in effect. File(/var/www/virtual/xxx/dev/htdocs/osp/output/brbr) 
    is not within the allowed path(s): (/home/virtual/xxx/dev/:/usr/share/php/:/tmp/:/var/www/virtual/xxx/dev/htdocs/osp/output/)
     in /home/virtual/xxx/dev/htdocs/brbr.php on line 2
    Code (markup):
    the strange thing is that both the php file and the directory i'm trying to create are within that path.

    any hint or idea would be highly appreciated! thank you.

    some additional facts:
    it's my own dedicated server running php 4.3, apache 2, vhcs 2.4 (software for administration).

    phpinfo() returns the right paths as open_basedir

    the folder
    virtual
    Code (markup):
    is placed in
    /home
    Code (markup):
    .
    /var/www/virtual
    Code (markup):
    is nothing but a SymLink. the FollowSymLink option is activated for the VirtualHost and it's working fine as other scripts are running perfectly.
     
    fanatique, Jan 5, 2006 IP
  2. Big 'G'

    Big 'G' Member

    Messages:
    89
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    48
    #2
    CHMOD Maybe
     
    Big 'G', Jan 5, 2006 IP
  3. fanatique

    fanatique Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    that's a good one but i really tried everything.

    chmod 777 -R osp/
    chown -R www-data osp/
    chgrp -R www-data osp/
     
    fanatique, Jan 5, 2006 IP
  4. n0other

    n0other Peon

    Messages:
    146
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hi. From the manual:
    
    When a script tries to open a file with, for example, fopen() or gzopen(), the location of the
    file is checked. When the file is outside the specified directory-tree, 
    PHP will refuse to open it. All symbolic links are resolved, 
    so it's not possible to avoid this restriction with a symlink.
    
    Code (markup):
    http://lt.php.net/features.safe-mode

    Good luck.
     
    n0other, Jan 5, 2006 IP
  5. fanatique

    fanatique Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    your quote sounds really interesting. the link suggests that it describes the behaviour when safe_mode is on and i switched it off - for test purposes.

    php_admin_flag safe_mode Off
     
    fanatique, Jan 5, 2006 IP