• I am running a WordPress site locally on my computer.

    Does WordPress allow the PHP ‘scandir’ function to access directories outside a WordPress site’s context? I simply want to scan for a specific directory that is located either anywhere locally or on a network drive that is accessed over the same LAN in which the computer locally hosting my WordPress exists.

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    WP has little influence over what PHP does. I tried scandir (from within WP) on a completely different drive (but still on localhost) and got the expected results. If you’re getting error messages, there’s likely a permissions problem with the directory requested. PHP and Apache run as a different user than the one you’re logged in as. If that user has the right permissions, scandir should work. The user and group used is specified in httpd.conf.

Viewing 1 replies (of 1 total)
  • The topic ‘ScanDir: Failed To Open Dir Error Message’ is closed to new replies.