Search code examples
phpdirectoryshared

PHP - Access folder shared network


I can access to the every server from my shared network with my user account.

I wrote a PHP Script in Wamp and want to access to a folder of my shared network.

I can access to it directly with their direct path : \128.xx.3.199\share\GMSA

But it doesn't work with my script:

<?php
$try =  '\\\\128.xx.3.199\share\GMSA\Test';
        var_dump( glob( $try . '\*.*' ) );
        var_dump( scandir( $try ) );

I think it's because Wamp hasn't the same permission than the current user account. But don't know what to do.


Solution

  • Your assumption could be right. Try the following:

    • Open 'Component Services' in Windows
    • Choose 'Services' and on the right navigate to the wampapache service (64 or 86)
    • Open the service, choose 'Log On' and change from 'Local System Account' to 'My Account'
    • Enter your credentials, apply and restart the service.