Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Apache on Windows, Access Denied (Code: 5) for folders on network

My setup is Windows 8 (64), WAMPSERVER 2.5, PHP 5.5.12 (64), and Apache 2.4.9 (64). However I believe this may be relevant for many other WAMP builds.

I needed my PHP application to use a repository of files that are located on a different computer on our network.

I attempted to use code like scandir('\\\\SERVER-NAME\\dir\\'); but I would get errors like [function.scandir]: Access is denied. (code: 5). Similarly [function.rename], [function.opendir], etc...

like image 737
azBrian Avatar asked Dec 04 '25 13:12

azBrian


1 Answers

The solution was to change the user that service "wampapache64" was using.

  1. Go to Services (start-key search "View local services")
  2. Find service "wampapache" or "wampapache64"
  3. right-click it
  4. Properties
  5. Got to the "Log In" tab
  6. Click the radio for "This account:"
  7. Set the account to "Administrator" or other account with read/write access to the pertinent network folder
like image 71
azBrian Avatar answered Dec 09 '25 02:12

azBrian



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!