Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

network folder inaccessible from php is_dir function

Status
Not open for further replies.

coldbohemia

Programmer
Jun 5, 2008
30
US
Is there a way to read a network folder with php?
I've tried using the "\\drive\folder\" and also using the mapped drive letter.
I keep getting "no folder by that name" error.

I have administrator privileges on that server, so I don't think it's a rights issue.

I also tried escaping the backslashes, using doubles, but the results are the same.
Also tried using forward slashes every which way.

Is this doable at all?
Thank you for your help.
 
It doesn't matter what your rights are, it matters what rights the PHP process has. To enable any access obviously is a security issue for a public website, where access is limited to webroot and below.

If this is just about localhost and you absolutely want to let PHP have all rights (quite like an executable compiled in any other language executed with your login), then you may change from the defaults.

What to do depends on your OS, that could also be MAC or anything else. You can figure it out with a little googling once you understand this:
1. PGP is run from the Webserver, that moight be Apache.
2. Processes started by some service account inherit the permissions of the system account that runs that and are equal or lower.

The normal solution to get access to files outside webroot is to add those folders via Aliases, not to higher permissions. It would also perhaps be better to run Apache on the computer where that directory is local, as the Webserver runs on local accounts only having local drives access.

Bye, Olaf.




Olaf Doschke Software Engineering
 
Thank you, Olaf:
I'll research this and try your solution.
Ciao.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top