Peter Perháč
Peter Perháč

Reputation: 20792

Shared network folders usage by PHP scripts - is this possible from outside the domain?

I am having the following difficulties: Three servers A,B,C : A,B in the same network domain; C in another. PHP scripts executing on server A write to a shared folder on server B. The same scripts executing on server C fail to write to server B.

PHP looks something like this:

oject->Output('\\\\serverB\\sharedfolder\\file.dummy');

Is there any way I can make this script work elegantly on server C?

When I remote-desktop to server C and want to see the contents of \\serverB\sharedfolder, a login prompt pops up and asks for a user name and password. This I can provide and subsequently access the shared folder on server B. But how could I do this from a PHP script? Is it possible?

Upvotes: 0

Views: 4220

Answers (2)

Ronald Conco
Ronald Conco

Reputation: 845

I think the easiest option with security in mind would be to write the content from server C in to a socket where server A,B reside and have an additional script which will save the content written from the socket to your shared folder.....

http://www.php.net/manual/en/function.fsockopen.php

Upvotes: 0

vartec
vartec

Reputation: 134711

The formats are:

  • UNC — \\servername\sharename%username:password
  • URL — smb://[[domain;]username[:password]@]server[/share[/path]]

Upvotes: 1

Related Questions