Both scandir and glob can only scan folders, but not files.

to traverse all files in a folder

with scandir and glob, only folders can be scanned, but no files can be scanned.

1> $path = "./upfiles/upload/3223/";
2> $list = scandir($path);
3> $list = glob($path."*");

to scan out files under / 3223 / folder, scandir returns false,glob and returns empty
. If you change the directory to / upload/, you can scan 3223 /
. This should indicate that php does not disable these two functions. Why can"t files be scanned?

Php
Sep.28,2021

if you change the directory to / upload/ , 3223 /
can be scanned.

relative path . / upfiles/upload/3223/ and absolute path / upload/ are not the same directory?

< hr >

2018-10-30

take a look at the file permissions. Does nginx / apache have permissions?
Menu