If you don't want to bother installing a bunch of dependencies, just use a system call to smbclient: // Quick and dirty samba authentication function // Be sure that the user running apache (usually "apache") has a proper // entry in /etc/sudoers to run /usr/bin/smbclient without a password // i.e. NOPASSWD // EXAMPLE sudoers entry: // apache localhost=NOPASSWD: /usr/bin/smbclient function smbauth($user,$pass,$server){ $command = "sudo /usr/bin/smbclient //$server/$user -U $user%$pass -c q"; $output = exec($command); return $output; } The implimentation as shown assumes that Home Directories are working for samba users. You could, however, have the auth try to access whatever share you'd like so you could technically set up rudimentary "group" auths based on who has access to different shares. A sucessful login will return NULL, otherwise the function will return the samba error. $server needs to be an IP address to work correctly on most platforms. Be aware that the plaintext password might be accessible to any users on the machine that is running the php script via the "ps" command. Might not be a good idea for multi-user systems. See the "-A" command line option of smbclient for a more secure way to pass the auth info using a temp file. see below: // Quick and not-so-dirty samba authentication function smbauth($user,$pass,$server){ // place auth info into temp file $tmpfile = tempnam("/tmp","smbauth_"); $handle = fopen($tmpfile, "w"); fwrite($handle, "username = $user\npassword = $pass\n"); fclose($handle); // use smbclient to attempt to access a share. $command = "sudo /usr/bin/smbclient //$server/$user -A $tmpfile -c q"; $output = exec($command); // delete the file unlink($tmpfile); return $output; }