Domanda

I have a PHP script that is trying to open the directory "C:\Users\userA\Desktop". However, the opendir() call is returning false. Here is my code:

$path = 'C:\Users\userA\Desktop';
var_dump (is_dir($path)); //prints TRUE
var_dump (is_readable($path)); //prints TRUE
var_dump (is_writable($path)); //prints TRUE
var_dump (open_dir($path)); //prints FALSE

When I run the above from the command line, everything is TRUE, and works as expected. When I run it via an Ajax call from a web browser, opendir fails. This is running in IIS 7.5. I have set the permissions for that directory to full permissions for "Everyone". Yet, it still seems to be some sort of permissions issue. I'm not sure where to go from here.

È stato utile?

Soluzione

I found the solution to my problem. I had added permissions to "C:\Users\userA\Desktop". I needed to go up one more directory. I granted IIS_IUSRS privileges to "C:\Users\userA", and it solved my problem.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top