PHP Cannot Access Virtual Directory [Answered]RSS

2 replies

Last post Sep 05, 2008 11:14 AM by voidstate

  • PHP Cannot Access Virtual Directory

    Sep 04, 2008 08:41 AM|voidstate|LINK

     Hi

    I have created a virtual directory in IIS 7. The virtual directory is named "sites" and points to "C:\sites".

    I want PHP to manipulate the files in this directory but I get the following error message when PHP tries to read it like this:

    echo '<pre>';
    $dir = scandir( 'sites' );
    print_r( $dir );
    echo '</pre>';

    PHP Warning: scandir(sites) [function.scandir]: failed to open dir: No error in C:\inetpub\wwwroot\test.php on line 15 PHP Warning: scandir() [function.scandir]: (errno 0): No error in C:\inetpub\wwwroot\test.php on line 15

    But if I use an absolute path it works fine:

    echo '<pre>';
    $dir = scandir( 'C:\sites' );
    print_r( $dir );
    echo '</pre>';

    I can also browse to files within the folder using my browser without a problem (]http://mysite/sites/myfile.gif).

    Looking at phpinfo(), there is a line that reads:

    Virtual Directory Support:  disabled

    Is that relevant? And if so, where do I change it?

    Thank you

    PHP

  • Re: PHP Cannot Access Virtual Directory

    Sep 05, 2008 02:20 AM|HostingASPNet|LINK

    Hello,

    You could check in http://php.net

    Regards

    WindowsHostingASP.NET - My favourite site for Windows and IIS hosting information.
    HowtoASP.NET - Free ASP.NET tutorials and source code.
  • Re: PHP Cannot Access Virtual Directory

    Sep 05, 2008 11:14 AM|voidstate|LINK

     I haven't been able to find anything either there or by Googling.