Get files from network driver
Get files from network driver
am 07.06.2007 03:52:49 von Han Jesse
I want to use PHP to get file from a network driver
$filename = "////MyServer//Share//1.tif";
$handle = fopen($filename, "r");
$contents = fread($handle, filesize ($filename));
fclose($handle);
?>
there is a Warning:
failed to open stream: Permission denied in D:\web\test.php on line 3
How to resolve the mistake?
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Get files from network driver
am 07.06.2007 04:36:27 von Niel Archer
Hi
this appears to be a permission error. The user PHP is running as
likely does not have permission to access to the file. Check
permissions on the directory/file and correct accordingly.
Niel
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Get files from network driver
am 07.06.2007 05:12:27 von Han Jesse
Hi Niel,
My apache and php are runing on Win2003Server(Server B),the file i
want to get on server A
i make a network driver from sever A named "Z" on server B,and
connected from my computer,then run the php code
what should i do to config my computer?
2007/6/7, Niel Archer :
> Hi
>
> this appears to be a permission error. The user PHP is running as
> likely does not have permission to access to the file. Check
> permissions on the directory/file and correct accordingly.
>
> Niel
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Get files from network driver
am 07.06.2007 05:40:14 von Niel Archer
Hi
Several thing you should check.
First, as they are both Server2K3, you should be using the full
permission system of windows not the simplified version XP defaults to.
So check the permissions set on the directory and file of the network
share. By default this is "Everyone" having read permission.But to
confuse things, "Everyone" doesn't include *everyone*, only
authenticated users, guests, and sometimes Anonymous logon.
Unless Apache/PHP are running under a User's account on server B that
also has a valid account on server A, they will not have permission to
access the directory. So you need to make sure that Apache/PHP are
using an acceptable account, or create one for them to run with. Be
aware that some accounts are not allowed to access network resources,
and this can include network shared directories. This mostly applies to
built in accounts and is only a problem if Apache/PHP are using one of
them to run, which is likely if they run as a service. You can find out
which User Apache is running under in the Task Manager or the Log On tab
of the properties of the Service.
Try these things for now to identify the problem.
Niel
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Get files from network driver
am 07.06.2007 07:00:25 von Han Jesse
Hi Niel
I change my apache running user , now i can get the file from network
share document !
Thank you !!
2007/6/7, Niel Archer :
> Hi
>
> Several thing you should check.
>
> First, as they are both Server2K3, you should be using the full
> permission system of windows not the simplified version XP defaults to.
> So check the permissions set on the directory and file of the network
> share. By default this is "Everyone" having read permission.But to
> confuse things, "Everyone" doesn't include *everyone*, only
> authenticated users, guests, and sometimes Anonymous logon.
>
> Unless Apache/PHP are running under a User's account on server B that
> also has a valid account on server A, they will not have permission to
> access the directory. So you need to make sure that Apache/PHP are
> using an acceptable account, or create one for them to run with. Be
> aware that some accounts are not allowed to access network resources,
> and this can include network shared directories. This mostly applies to
> built in accounts and is only a problem if Apache/PHP are using one of
> them to run, which is likely if they run as a service. You can find out
> which User Apache is running under in the Task Manager or the Log On tab
> of the properties of the Service.
>
> Try these things for now to identify the problem.
>
> Niel
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php