Previous Next

Thread: PHP Cannot Access Virtual Directory

Last post 09-05-2008 11:14 AM by voidstate. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 09-04-2008, 8:41 AM

    PHP Cannot Access Virtual Directory

     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

    Tags:
  • 09-05-2008, 2:20 AM In reply to

    Re: PHP Cannot Access Virtual Directory

    Hello,

    You could check in http://php.net

    Regards

  • 09-05-2008, 11:14 AM In reply to

    Re: PHP Cannot Access Virtual Directory

     I haven't been able to find anything either there or by Googling.
Page 1 of 1 (3 items)
Page view counter