0
votes

I have a php website on an IIS webserver. I want to use scandir on a directory on another server. Therefor I created a virtual directory for my website on IIS. (conntected as a user that has permission on this directory. (IUSR has permission too, just in case...)

my code is: (imp is the name of the virtual directory in the root directory of my website)

$dir = "imp/xxx/xxx/xxx/02";

$allFiles = scandir($dir);

but it is not working. error.log:

scandir(imp/xxx/xxx/xxx/02,imp/xxx/xxx/xxx/02): Das System kann den angegebenen Pfad nicht finden. (code: 3) in C:\inetpub\wwwroot\test\index.php on line 13

-> "System can't find the path"

Can you help me out?

Best regards

1
the IIS and the other server are in the same network - Mr. K. O. Rolling
i need to activate the "search directory" function in IIS. now i can access the virtual directory via browser (firefox). But when i try to access it via php i get following error: http://<ip>:<port>/imp02/): failed to open dir: not implemented - Mr. K. O. Rolling

1 Answers

0
votes

okay, after a long time I (or rather a workmate) found the solution. In the IIS the user for the application pool (not the website itself), which runs the website, has to be changed to a user, that has permission on the other server. (by default it is something like "webserviceIdentity...") After that adress the directory like that: \\server\path\to\dir