0

is here any way to access network files with remote login? It means, I have application server (Windows server), file server (connected to app server by LAN) and client terminals. File server is protected by login and password and I need to access it from the server scripts. I'm using now following code:

system('net use R: "//FileServer/data" pa55w0rd /user:user /persistent:no>nul 2>&1');

When I've tried it at the first time, it worked, but god knows why, now it's not working :-(. Any ideas please? Thanks.

P.S.: It's not working even if I mount file server as an unit of the application server.

Honza
  • 761
  • 1
  • 8
  • 25

2 Answers2

0

You can use something like this SMB4PHP

66Ton99
  • 410
  • 6
  • 17
  • Thank you, there is a problem with installing FTP server or Samba on file server. But I found where the problem with mounting actually is. Apache service is running under SYSTEM user, but SYSTEM has no right to mount units. The solution of this problem is to change the Apache service user. If I change Apache service to be run under administrator user, it's working. But I don't like it, it seems to be dangerous to me. Is possible to grant SYSTEM user mounting new units? – Honza Mar 31 '15 at 09:50
0

with my collegue we solved the problem according to these two posts: https://serverfault.com/questions/426288/permanently-mount-network-share-without-the-need-for-log-on-windows and this one Map a network drive to be used by a service. It's necessary to use Sysinternals Suite application to "hack" system and mount the drive under authority\system account. After that, Apache (SYSTEM) has granted access to this drive. So thank you very much.

Community
  • 1
  • 1
Honza
  • 761
  • 1
  • 8
  • 25