Is it possible to access a network share using PHP?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
joshelley
Forum Newbie
Posts: 3
Joined: Sat Sep 23, 2006 10:21 pm

Is it possible to access a network share using PHP?

Post by joshelley »

I'm trying to create a php script on a local server to read data from a shared folder from another computer on the same LAN and Workgroup as the php server. Is this possible?

::edit::

The php server is running SUSE linux and is trying to connect to a microsoft network's share

::edit::
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

The linux bit is vital. A "network share" is specific to the OS. In linux you'd just use NFS (server:/share) but in window they use a windows networking protocol (\\server\share).

To use the windows file sharing protocol under linux you need samba.
joshelley
Forum Newbie
Posts: 3
Joined: Sat Sep 23, 2006 10:21 pm

Post by joshelley »

Yeah I've heard of samba. Is PHP compatible with Samba?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

joshelley wrote:Yeah I've heard of samba. Is PHP compatible with Samba?
Well you can "mount" drives in samba with smbmount so php would be able to access those.
joshelley
Forum Newbie
Posts: 3
Joined: Sat Sep 23, 2006 10:21 pm

Post by joshelley »

duh, that should've clicked for me lol.
Post Reply