open_basedir - relative path RRS feed

  • Question

  • User-168115865 posted
    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! :)

    Tuesday, January 6, 2009 3:01 PM


  • User-1796730883 posted

    I would suggest you to post this in PHP forum

    And, hope this link helps:



    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Monday, January 12, 2009 10:13 PM