php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9234 Windows shares are not accessible
Submitted: 2001-02-12 20:17 UTC Modified: 2001-05-11 21:01 UTC
From: c dot just at phoenixdigital dot com Assigned:
Status: Closed Package: Directory function related
PHP Version: 4.0.4pl1 OS: Win32
Private report: No CVE-ID: None
 [2001-02-12 20:17 UTC] c dot just at phoenixdigital dot com
Access to windows shares via the network used to be possible with php3.0.16. Now they just don't show up.
ie
A windows share "\\NTServer\wwwroot\" cannot be accessed anymore. The permissions for the directory are set correctly but it still fails.

Below is some test code. It is possible your text input box in the form may stuff up the formatting of the code.
---------------------------------
<h1>Files listing</h1>

<?
#$directory = "\\\\nt4server\\wwwroot";
$directory = "\\\\cwdevel\\ddrive\\BCCINET\\WWWROOT\\";
#$directory = "d:\\inetpub\\wwwroot\\businessservices\\";
#$directory = "d:\\inetpub\\wwwroot\\publishing\\";

function dirfilecopy($basedir,$dir="",$files = ""){

	if($files == "")
		$files = array();
		
	# SET LIST OF VALID EXTENSIONS TO BE USED IN REGEXP
	$extensionlist = "\.asp$|\.class$|\.css$|\.dat$|\.dnp$|\.doc$|\.exe$|\.gif$|\.htm$|\.html$|\.inc$|\.jpg$|\.js$|\.pia$|\.pdf$|\.phtml$|\.php3$|\.stm$|\.shtm$|\.shtml$|\.wpd$|\.xls$|\.zip$";
	$fileignore = "^Copy of";
	
	
	if(is_dir($basedir.$dir))
		echo "This is a directory<BR>";
	else
		echo "Nope<BR>";
		
	$d = dir($basedir.$dir);
	echo "Handle: ".$d->handle."<br>\n";
	echo "Path: ".$d->path."<br>\n";
	while($entry=$d->read()) {

		if(is_dir($basedir.$dir.$entry) && ($entry != ".") && ($entry != "..")){
			$files = dirfilecopy($basedir,$dir.$entry."\\",$files);
		}else{
			if(!eregi($fileignore,$entry)){
				if(eregi($extensionlist,$entry)){		
 		  	 	$files[] = $dir.$entry;
    		}
    	}
		}
	}
	$d->close();

	return($files);
}

$files = dirfilecopy($directory);

for ($i=0; $i<count($files); $i++){
	$info = stat($directory.$files[$i]);
	echo $directory.$files[$i]."   ".date("H:i d F Y",$info[9])."<BR>";
}

?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-13 01:14 UTC] derick@php.net
This is all ready known. It's on the todo list for now (and it was submitted earlier so marking it duplicate)
 [2001-05-11 21:01 UTC] sniper@php.net
Fixed in CVS. Fix will be in PHP 4.0.6

--Jani

 [2011-08-30 20:36 UTC] yago@php.net
Automatic comment from SVN on behalf of yago
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=315821
Log: Approved change made by anonymous #9234
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Nov 26 00:01:22 2020 UTC