PHP 4.0 Bug #9234: Windows shares are not accessible
| From: | c dot just at phoenixdigital dot com | Date: | Tue, 13 Feb 2001 01:17:07 +0000 |
| Subject: | PHP 4.0 Bug #9234: Windows shares are not accessible | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-46459@lists.php.net to get a copy of this message | ||
From: c.just@phoenixdigital.com
Operating system: Win32
PHP version: 4.0.4pl1
PHP Bug Type: Directory function related
Bug description: Windows shares are not accessible
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>";
}
?>
--
Edit Bug report at: http://bugs.php.net/?id=9234&edit=1