« Previous Next »

Thread: open_basedir - relative path

Last post 01-12-2009 10:13 PM by Andrew Zhu - MSFT. 1 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (2 items)

Sort Posts:

  • 01-06-2009, 3:01 PM

    • RustySpoon
    • Top 500 Contributor
    • Joined on 12-14-2008, 10:41 AM
    • Sopron - Hungary
    • Posts 14

    open_basedir - relative path

    Hy Guys!

    I have a win2k8 + iis7 + php fastcgi box. FastCGI configured based on this article: http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-70/.

    Im using open_basedir directive for all virtualhosts. All works fine (no premission, file opening or open_basedir probleme), but when I try to use the is_file(), is_dir() (and other file handler functions) with relative urls: is_file("/somedir/somefile.txt"); I get this php warning:

    Warning: is_file() [function.is-file]: open_basedir restriction in effect. File(/somedir/somefile.txt) is not within the allowed path(s): (C:\inetpub\wwwroot\host\www) in C:\inetpub\wwwroot\host\www\index.php on line 1

    Its works fine if Im using without "/" or with DOC_ROOT: 

    is_file("somedir/somefile.txt"); - ok
    is_file($_SERVER["DOCUMENT_ROOT"]."/somedir/somefile.txt"); - ok!!

    (I think) in my php ini open basedir is right:

    open_basedir: C:\inetpub\wwwroot\host\www

    With different format open_basedir:  C:\inetpub\wwwroot\host\www\ (<-- the slash at the end)  i have the same probleme..

     Please help! :)

  • 01-12-2009, 10:13 PM In reply to

    Re: open_basedir - relative path

    I would suggest you to post this in PHP forum

    And, hope this link helps:

     http://bugs.php.net/bug.php?id=41518

    Regards

    Sincerely
    Microsoft Online Community Support
    Andrew Zhu - MSFT


    “Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
Page 1 of 1 (2 items)
Microsoft Communities