Eşleşen Ağ Sürücüler

3 Cevap php

Benim ev ağındaki bir bilgisayara bir ağ sürücüsünü eşleştirilmiş. Şimdi PHP üzerinden erişmek için çalışıyorum - Ben bu hızlı testi yaptım:

echo opendir('Z:\\');

Bu bana verir:

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

Ben burada yanlış ne yaptım?

Ben bu yüzden onlar için UNC yolunu almak için bir yol var ve ben bunu erişmeye çalıştığınızda belki çalışacaktır benim kullanıcıların UNC yolunu yazarak istemiyorum? Bu, Microsoft dilde mümkün ama ben bunu yapmak için PHP nasıl emin değilim - belki bir cmd.exe komutunu kullanarak?

Bunu görebiliyorum ve bunu erişebilirsiniz olarak eşlenen sürücü mevcutsa, lütfen unutmayın. Ayrıca bu sürücüyü erişebilir IF Ben bu konuda şikayetçi olacağını varsayarak yaşıyorum gibi izinleri bir sorun gibi görünen ... doğru değil mi?

Herhangi bir yardım için teşekkür ederiz

3 Cevap

User Contributed Notes to opendir() bu var:

Ben bu opendir fonksiyonu kullanarak ağ sürücüleri erişmeye çalışıyordu. Ben bir ağ sürücüsüne erişmek ve nihayet, ben cevap buldu neredeyse imkansız olduğunu söyleyerek çok mesajlarını okumak; ya aynı makine veya başka bir makinede PHP ile bir ağ sürücüsüne erişmek için takip edilmesi gereken 2 adım vardır.

Bu durumda, kullanıcı hakları ne kullanıcı PHP / web sunucusu üzerinde çalışan bağlı olarak haklarından farklı olabilir sorun olması gerçekten görünüyordu.

Open the Services MMC by going to Start -> Run (or by using the search box, if using Windows 7) and typing Services.msc and pressing enter. Find the Apache service. Having never used WAMP, I have no idea what it's been named. Hopefully it starts with the word "Apache" though, and thus shouldn't be too hard to find. Right-click on the service and select Properties. Switch to the Log On tab. Select the radio button next to "This account:" and enter in the credentials for the user account you want to run Apache under. If it's a network/domain account, use the "DOMAIN\user" syntax (or search for the account using the Browse button). Select OK and restart the Apache service. Verify that your changes worked by looking for the "httpd.exe" process in Task Manager and checking to see which user name the process is running under.

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

basit, kullanımı: "\\\\server\\dir\\subfolder" yolu olarak. Eğer "sunucu" erişebilirsiniz emin olun.

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