问题描述
安装在Windows XP计算机上的PHP(XAMPP)中的我试图读取本地网络服务器上存在的目录。我使用 is_dir()
来检查是否是可以阅读的目录。
在Windows资源管理器中,我键入 \\\\server\dir
,并显示该目录。
当我映射网络驱动器时,可以使用 z:\dir
访问它。
在PHP中我有这个脚本:
<?php if(is_dir($ dir){echo'success'}) ?>
对于 $ dir
我试过: p>
-
/ server / dir
-
// server / dir
-
\server\dir
-
\\server\dir
-
\\\\ \\\server\\dir
和
-
z:\dir
-
z: \\\dir
-
z:/ dir
-
z:// dir
但是我从来没有获得成功?
任何想法?
thx
我通过在服务器的注册表中更改一些东西来解决它,这个讨论:
感谢VolkerK和Gumbo!
我喜欢stackoverflow和他们的伟大的人谁帮助你如此难以置信的快速!
编辑(取自php.net):
将RestrictNullSessAccess = 0添加到您的注册。
within PHP (XAMPP) installed on a Windows XP Computer Im trying to read a dir which exists on a local network server. Im using is_dir()
to check whether it is a dir that I can read.
In Windows Explorer I type \\\server\dir
and that dir is being shown.When I map a network drive a can access it with z:\dir
as well.
In PHP I have that script:
<?php if( is_dir($dir){ echo 'success' } ) ?>
For $dir
I tried:
/server/dir
//server/dir
\server\dir
\\server\dir
\\\\server\\dir
and
z:\dir
z:\\dir
z:/dir
z://dir
But I never get success?Any idea?thx
I solved it by changing some stuff in the registry of the server as explained in the last answer of this discussion:
http://bugs.php.net/bug.php?id=25805
Thanks to VolkerK and Gumbo anyway!I love stackoverflow and their great people who help you so incredibly fast!!
EDIT (taken from php.net):
add RestrictNullSessAccess=0 to your registery.
这篇关于php访问Windows下的网路的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!