php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31741 Error while opening remote file
Submitted: 2005-01-28 15:48 UTC Modified: 2005-02-02 04:21 UTC
From: rvk at au dot ru Assigned:
Status: Not a bug Package: *Directory/Filesystem functions
PHP Version: 5.0.3 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
4 + 47 = ?
Subscribe to this entry?

 
 [2005-01-28 15:48 UTC] rvk at au dot ru
Description:
------------
I need to load .csv file from remote computer. When I run php like command-line script - result found. Remote file opening and display correctly, but when I run my php file at IIS, rarely! file opening correctly. Browser display: "failed to open stream: Permission denied in ...". Remote file have "readonly" attributes and stored at computer with Windows-98 operation system. At same time no one program will read or write this file. The "read" rights on file set for everyone, not for me only.
Catalog with this file shared for local intranet.
That may be wrong? 
 

Reproduce code:
---------------
$file = file("\\\\remote_computer_name\\catalog\\myfile.csv");
$file[0] = explode(",", $file[0]);
foreach($file[0] as $key => $field) echo $field."\n";

Expected result:
----------------
field_1
field_2
...
field_n

Actual result:
--------------
Warning: file(\\Mac2111\var\01_01_2005\arh_3.csv) [function.file]: failed to open stream: Permission denied in c:\Inetpub\wwwroot\php\get_fields.php on line 20

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-29 17:08 UTC] pollita@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Under a default configuration, IIS runs as IUSER_YOURCOMPUTERNAME which is a local users account with access rights on the local computer only.  In order for IIS to access files on a remote computer it must have an account on that remote computer with a matching username and password.

It works at the command line because it's using your account credentials at that point.
 [2005-01-30 15:06 UTC] rvk at au dot ru
I know, that IIS working as IUSR_COMPUTERNAME account... But rarely! it working properly and I see my data at browser... Otherwise I should not post this message as bug report. :-(
 [2005-02-02 04:21 UTC] rvk at au dot ru
Yes, this is no PHP issue.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 21:01:27 2024 UTC