在IIS 7上添加PHP写入权限
我需要一个 PHP 脚本来获得目录的写入权限。 PHP 5.3 在 IIS 7 下作为 FastCGI 运行,Windows Server 2008 作为 OP。在我的 php 错误日志中,当脚本尝试写入文件时,我收到“权限被拒绝”。
我该如何解决这个问题?我尝试将所有权限授予 IIS_IUSR 和 IUSR_myservername(右键单击我的文件夹),但它不起作用。
任何帮助将不胜感激,
问候,
朱利安
I need a PHP script to have writing permission in a directory. PHP 5.3 is running as FastCGI under IIS 7 with windows server 2008 as OP. On my php error logs, I got "permission denied" when the script attempts to write a file.
How can I sort this out? I tried to give all right to IIS_IUSR and to IUSR_myservername (with a right click on my folder) but it didn't work.
Any help would be very appreciate,
Regards,
Julien
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我有相同的设置,我必须授予写入权限:
IUSR
IIS AppPool\<>
I have the same setup and I have to give write permission to:
IUSR
IIS AppPool\<<AppPoolName>>
实际上,情况有点复杂。
首先要做的是在相关网站上创建一个简单的 PHP 文件。 (在相关网站上创建该文件很重要,因为每个网站可能有不同的设置。)该文件的内容应该是:
使用浏览器导航到该文件。
** 情况 1 **
如果您的浏览器显示:
然后,您需要执行以下命令(您需要将“默认网站”替换为您在 IIS 中为网站指定的名称):
您将收到如下所示的答案this :
您要查找的信息是
anonymousAuthentification
标记的username
属性的值。IIS AppPool\AppPoolName
授予写入权限(将“AppPoolName”替换为您网站的应用程序池的名称)。** 情况 2 **
如果您的浏览器显示:
您需要向
IIS AppPool\AppPoolName
授予写入权限(将“AppPoolName”替换为您网站的应用程序池的名称)。Actually, it's a little bit more complicated.
The first thing to do is to create a simple PHP file on the concerned website. (It's important to create the file on the concerned website because each website can have a different setting.) The content of this file should be:
Navigate to this file using a browser.
** Case 1 **
If your browser shows :
Then, you need to execute the following command (you need to replace "Default Web Site" by the name you gave to your website in IIS) :
You will receive an answer which looks like this :
The information you are looking for is the value of the
username
attribute of theanonymousAutthentification
tag.IIS AppPool\AppPoolName
(replace "AppPoolName" with the name of your website's application pool).** Case 2 **
If your browser shows :
You need to give write permissions to
IIS AppPool\AppPoolName
(replace "AppPoolName" with the name of your website's application pool).您需要授予PHP写入权限,而不是IIS。这意味着运行 PHP 的用户帐户需要权限(可能与运行 IIS 的用户帐户相同)。
You need to give PHP writing permission, not IIS. This means the user account that PHP is running on needs permission (probably the same one IIS is running on).