tags:

views:

69

answers:

1

have to access some media files from Network storage to be accessible through SMB and Common Internet File System. PHP website is required to do file manipulation operations on remote storage block. You may suggest some alternate method or if you have any idea or may help on:

  1. configuring SAMBA/SMB/CIFS
  2. SMB/SAMBA/CIFS client configuration
  3. Accessing file system through PHP - research shows that PHP provides smb4php classes in this regard, but no support on how to use in a complete setup.
A: 

Whether or not you can mount the SMB share directly on your host OS will depend on what your host OS is. That you are talking about SAMBA suggests it might be some sort of Unix / POSIX / Linux - but which one?

Most versions of Linux support a filesystem type of smbfs (usually the man page for mount will list the supported types).

mount -t smbfs -o username=Bill,password=billions //msbox/netshare /some/local/dir

(note that the smbfs vfs is developed by the same people who write Samba - but is a seperate product).

Samba ships with a cli client smbclient. To fetch a file using this you just need to exec it with the right arguments (note that if you don't sepcify all the required arguments on the command line, smbclient will drop into an interactive mode). See the man page installed for smbclient for details of the arguments and their formatting.

research shows that PHP provides smb4php classes

No it doesn't. I assume that you're talking about this - which is not supplied by the people who maintain PHP. It is just a wrapper around the smbclient program. As per my comment on the site (see support forum), yes, the documentation is not great - but I've added the details on the format of the connection string.

Please cite your sources.

symcbean