0

During two hours, I've tried to find an issue for my problem. I have a script which sorts folders of System32 :

$iterator = new DirectoryIterator($_SERVER["SystemRoot"] ."\System32");
foreach ($iterator as $fileinfo) {
    if ($fileinfo->isDir())
        echo $fileinfo->getFilename() . "<br />";
}

But when I check result, I see that some folders are missing.

http://img15.hostingpics.net/pics/46385214pb.jpg

Someone has an idea to solve it ? Thanks a lot.

Edit : When I create a new folder, it's not find too.

Edit' : I work on a Windows Server 2012 R2 (IIS 8.5).

Álvaro González
  • 142,137
  • 41
  • 261
  • 360
Sackey
  • 392
  • 2
  • 11
  • check read permission of dns for webserver – Sugumar Venkatesan Jun 13 '16 at 09:18
  • Everybody can see it : http://img15.hostingpics.net/pics/501745pb2.jpg – Sackey Jun 13 '16 at 09:21
  • Windows has been using UAC (User Account Control) for some years now. A program that tries to create files in system-wide locations will be tricked into thinking he succeeded but actual file will be somewhere else. Not sure if you took that into account. – Álvaro González Jun 13 '16 at 12:00
  • There is a way to find what is the real path ? – Sackey Jun 13 '16 at 12:11
  • First of all, gather some basic information. What user created the *dns* folder? What user does your PHP process run as? Is UAC enabled or disabled? – Álvaro González Jun 13 '16 at 14:15
  • Thanks for your help. I have a php script on this server that update a log file : it gets ip address of client website. It's executed by a program every 15 minuts : it works fine and there is no problem when I update internal logs file (Inetpub > wwwroot). So, dns folder is created for IIS users. I have disabled UAC after your answer and reboot the server, but I always cannot find dns folder by php. :( – Sackey Jun 13 '16 at 15:08
  • When UAC is enabled, files created in restricted locations end up in a place like "C:\Users\johnsmith\AppData\Local\VirtualStore". However, I suspect your PHP process runs under a system user called `IUSR_` that probably doesn't have a home directory. (Now I have to ask: why save a such log in system folders?) – Álvaro González Jun 14 '16 at 10:24

0 Answers0