PHP scandir() gives “Permission Denied” even though apache has permissions to directory When I use PHP’s scandir() as follows: