Applied Network Drives

I connected a network drive to a computer on my home network. Now I'm trying to access it through PHP - I did this quick test:

echo opendir('Z:\\');

This gives me:

Warning: opendir(Z:\) [function.opendir]: failed to open dir: No error in C:\wamp\www\webs\tester-function.php  on line 3

What have I done wrong here?

I don’t want my users to enter a UNC path, so is there a way to get the UNC path for them, and maybe this will work when I try to access it? This is possible in Microsoft languages, but I'm not sure how to get PHP to do this - perhaps using the cmd.exe command?

Please note: a mapped drive exists as I see it and I can access it. This is also not a permissions issue, as I assume that he would complain about it if he could access this drive ... right?

Thank you all for your help.

+3
3

opendir() :

, opendir. , , , , ; PHP .

, , , , PHP/-.

+5

, : "\\\\server\\dir\\subfolder" . , "".

.

$arquivo = "\\\\server\\dir\\subfolder\\file.txt"; echo is_file($arquivo); //print 1.

+3

MMC Services, → ( , Windows 7) "Services.msc" "Enter".    Apache. WAMP, , . , "Apache", , , .    "".    " ".    " :" , Apache. /, "DOMAIN\user" ( "" ).    "" Apache.   , , "httpd.exe" , .

link http://board.phpbuilder.com/board/showthread.php?t=10371870&page=2

+2
source

Source: https://habr.com/ru/post/1740163/


All Articles