#48852 [Fbk->Opn]: php windows save file to remote share strange access denied
| From: | trutas dot ctx at gmail dot com | Date: | Wed, 08 Jul 2009 15:13:51 +0000 |
| Subject: | #48852 [Fbk->Opn]: php windows save file to remote share strange access denied | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-139481@lists.php.net to get a copy of this message | ||
ID: 48852
User updated by: trutas dot ctx at gmail dot com
Reported By: trutas dot ctx at gmail dot com
-Status: Feedback
+Status: Open
Bug Type: IIS related
Operating System: Windows Server 2003 x64 IIS6.0
PHP Version: 5.3.0
New Comment:
Note:
test.php is located at \\share\intraroot$\site\
i've just tested it further and tryed a few workarounds:
- it doesn't work with relative path (since both files are within the
same share) "..\\folder\\file.txt";
- it doesn't work with dirname(__FILE__)."\\..\\folder\\file.txt";
- does not work with forward slashes //share/...
- the error is "permission denied" even if the destination folder
doesn't exist - i've found this because at a time i had wrongly typed
\\\\share\\intraroot$folder\\file.txt - that does not exist;
I'm guessing it has something to do with the home directory in IIS
being on a remote share - the production servers are clustered...
Every other technology (vbscript, .NET) on IIS accesses the shares
normally.
Previous Comments:
------------------------------------------------------------------------
[2009-07-08 15:03:05] pajoye@php.net
How did you install php? FCGI or ISAPI?
------------------------------------------------------------------------
[2009-07-08 14:01:20] trutas dot ctx at gmail dot com
Description:
------------
Access denied on a simple file_put_contents
- the strange thing is vbscript test file on the same folder works
- destination has everyone->modify/read/write.
localhost/test.asp
localhost/test.php
i think it is not relevant but test.php and test.asp are located on the
same \\share that we're trying to save the file to (but on a different
folder). Apparently it works if we map this share to a local drive and
use the local path (eg. E:\ );
file_get_contents works fine.
We are using Windows 2003 Server x64, IIS 6.0, PHP 5.3RC04 x64 via MS
FastCGI .
Reproduce code:
---------------
<?php
file_put_contents("\\\\share\\intraroot$\\folder\\file.txt", "...");
?>
Expected result:
----------------
file saved with content "..."
Actual result:
--------------
PHP Warning: file_put_contents(\\share\intraroot$\folder\file.txt):
failed to open stream: Permission denied in ...
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48852&edit=1