-1

if i try to access data from my computer it works

$test = "\\\\Pcname\folder\blabla.txt";
or
$test = "D:\\folder\blabla.txt;
if (!file_exists($test)) {
    die("Could not find file.");
}

but i want to access data from local network(shared folder) but i got error and i have no clue how to make it works

i try this code

$test= "http://10.0.0.107/folder/blabla.txt";
or using computer name
$test= "http://Another-Pc/folder/blabla.txt";

I also make sure if permision folder are full control for everyone and even make a group

dpz
  • 79
  • 8
  • I believe the question is related to trying to read network resources from PHP that's running on a LAN, not access resources on other webservers on a LAN, necessarily. – MyStream Jan 15 '13 at 03:28
  • @MyStream yeah exactly, can you explain where i got wrong? or i have to add something to acces that resources – dpz Jan 15 '13 at 03:32
  • I don't know how to do it, but I think the question's valid and didn't deserve a downvote. I'd be interested in an answer too. – MyStream Jan 15 '13 at 03:34
  • 1
    Related to this: http://serverfault.com/questions/167213/how-do-i-configure-iis-to-allow-access-to-network-resources-for-php-scripts perhaps but Apache-oriented? – MyStream Jan 15 '13 at 03:37
  • @MyStream thanks sir for up vote, maybe someone had different perspective with my question – dpz Jan 15 '13 at 03:38
  • @dpz: Have you tried network access, e.g. //computer-name//resource/path/ ? – MyStream Jan 15 '13 at 03:40

1 Answers1

1

If you are trying to access it locally, that would be definitely a burden and may not be possible. First, because PHP will not have these settings (security purposes) and second depending on the OS, OS may or may not allow this.

As NullUserException mentioned, you should either install Apache or IIS to the PC to serve the HTTP and open the port 80 to the Network then you can check the file with the http URL.

I hope this helps.

Taicho
  • 143
  • 5