It's possible that PHP doesn't have access to cmd.exe or net.exe on the Windows system, based on the credentials that it's running under. Try something like this instead:
$WshNetwork = new COM("WScript.Network");
$WshNetwork->MapNetworkDrive("$letter:", '\\\\server\name', FALSE, 'username', 'password');