Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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 \serverdir 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
  • serverdir
  • \serverdir
  • \\server\dir

and

  • z:dir
  • z:\dir
  • z:/dir
  • z://dir

But I never get success? Any idea? thx

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.0k views
Welcome To Ask or Share your Answers For Others

1 Answer

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):

The service has limited access to network resources, such as shares and pipes, because it has no credentials and must connect using a null session. The following registry key contains the NullSessionPipes and NullSessionShares values, which are used to specify the pipes and shares to which null sessions may connect: HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesLanmanServerParameters Alternatively, you could add the REG_DWORD value RestrictNullSessAccess to the key and set it to 0 to allow all null sessions to access all pipes and shares created on that machine.`

add RestrictNullSessAccess=0 to your registery.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...