1

I am trying to opendir on a SMB mounted server. I'm running XAMPP on a Mac. I keep getting "No such file or directory" but i can cd to the directory just fine from terminal using the same path.

$dir = opendir("/Volumes/photorepos/Partners");

echo $dir;
Philipp Maurer
  • 2,480
  • 6
  • 18
  • 25
  • you are going outside your document root defined for the server so it is correct. Probably you can try with a symlink to that path and to try to refer to the symlink. Anyway take also into account user permissions on the files you are trying to open – Lelio Faieta Jan 17 '18 at 15:19
  • I have full permissions to that directory, so it shoudln't be an issue to get to it. I'm trying to get to the directory to count files, so i don't think symlink will work since the next step after i open the directory will be to glob the files in it. right? – Brian Flieck Jan 17 '18 at 15:34
  • the webserver user must have at least read permission on the directory and the directory must be inside the document root. – Lelio Faieta Jan 17 '18 at 15:35
  • Your webserver probably runs as user `_www` and group `_www` so that user needs access, not you. Check your Apache config file for the `User`. – Mark Setchell Jan 17 '18 at 18:40

0 Answers0