IIS上的PHP具有基本身份验证 [英] PHP on IIS with basic authentication

查看:100
本文介绍了IIS上的PHP具有基本身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在IIS上运行PHP,需要在

特定文件夹上设置基本身份验证,例如 http://domain.com/private/

我已将用户设置在服务器上并分配了
$的权限b $ b文件夹。


当请求文件夹中的文件时,我得到登录/密码

提示并输入正确的凭据给我文件,除了

for .php文件。


.php文件是基本的,只需<?php echo" Hello

world" ;; ?作为内容。

http://domain.com /private/test.txt 完美无缺,但
http: //domain.com/private/test.php 拒绝访问,仅授予:

未授权

由于凭据无效,访问被拒绝。


我试过给用户完全权限;我已经确保了IIS管理器属性中的应用程序设置配置>

主目录,允许PHP文件。

还有其他建议吗?

解决方案

Joff写道:


我正在运行PHP在IIS上,需要在

特定文件夹上设置基本身份验证,例如 http ://domain.com/private/

我已将用户设置在服务器上并分配了

文件夹的权限。


当请求文件夹中的文件时,我得到登录/密码

提示并输入正确的凭据给我文件,除了

for .php文件。


.php文件是基本的,只需<?php echo" Hello

world" ;; ?作为内容。

http://domain.com /private/test.txt 完美无缺,但
http: //domain.com/private/test.php 拒绝访问,仅授予:

未授权

由于凭据无效,访问被拒绝。


我试过给用户完全权限;我已经确保了IIS管理器属性中的应用程序设置配置>

主目录,允许PHP文件。


还有其他建议吗?



你所描述的听起来像windows集成认证不像

基本认证。在这种情况下,用户登录需要访问服务器上的文件

。如果这是你的意思,用户甚至可能需要

执行该.php文件的权利以及执行php

本身的权利。


Heiko


在这种情况下,它可能是我对IIS基本身份验证的理解

及其如何(应该)这是我正在做的事情:


IIS管理器domain.com - 私人文件夹属性目录

安全验证和访问控制 - 编辑

未选中启用匿名访问

仅选中基本身份验证(密码以明文形式发送)


然后分配用户:


IIS管理器domain.com - 私人文件夹权限分配完整

控制测试用户

(我现在分配完全控制权来尝试确定

问题所在的位置)


Joff写道:


在这种情况下,它可能是我对IIS基本身份验证的理解

及其如何(应该)这是我正在做的事情:


IIS管理器domain.com - 私人文件夹属性目录

安全验证和访问控制 - 编辑

未选中启用匿名访问

仅选中基本身份验证(密码以明文形式发送)


然后分配用户:


IIS管理器domain.com - 私人文件夹权限分配完整

控制测试用户


(我现在分配完全控制权来尝试确定

问题所在的位置)



您是在运行PHP作为CGI还是isapi模块?


-

========== ========

删除x来自我的电子邮件地址

Jerry Stuckle

JDS计算机培训公司
js ******* @ attglobal.net

==================


I''m running PHP on IIS and need to set basic authentication on a
particular folder, e.g http://domain.com/private/
I''ve set the user on the server and assigned permissions to the
folder.

When requesting files within the folder, I get the login/password
prompt and entering the correct credentials gives me the file, except
for .php files.

The .php file is as basic as they come with just <?php echo "Hello
world"; ?as the contents.

http://domain.com/private/test.txt works perfectly, however
http://domain.com/private/test.php denies access, giving only:
"Unauthorized
Access is denied due to invalid credentials."

I''ve tried giving the user full permissions; I''ve ensured that
Application Settings configuration within IIS Manager properties >
Home Directory, allows PHP files.
Any other suggestions?

解决方案

Joff wrote:

I''m running PHP on IIS and need to set basic authentication on a
particular folder, e.g http://domain.com/private/
I''ve set the user on the server and assigned permissions to the
folder.

When requesting files within the folder, I get the login/password
prompt and entering the correct credentials gives me the file, except
for .php files.

The .php file is as basic as they come with just <?php echo "Hello
world"; ?as the contents.

http://domain.com/private/test.txt works perfectly, however
http://domain.com/private/test.php denies access, giving only:
"Unauthorized
Access is denied due to invalid credentials."

I''ve tried giving the user full permissions; I''ve ensured that
Application Settings configuration within IIS Manager properties >
Home Directory, allows PHP files.
Any other suggestions?

What you describe sounds like windows integrated authentication not like
basic authentication. In this cases the user login on needs access to
the file on the server. If it is what you mean, the user may even need
the rights to execute that .php file as well as the right to execute php
itself.

Heiko


In that case it might be my understanding of IIS basic authentication
and how it (should) works.

This is what I''m currently doing:

IIS Manager domain.com - private folder properties Directory
Security Authentication and access control - Edit
Unchecked "Enable anonymous access"
Checked only "Basic authentication (password is sent in clear text)"

Then to assign the user:

IIS Manager domain.com - private folder permissions Assign full
control to "test" user
(I''m assigning full control at present to try and establish where the
problem lies)


Joff wrote:

In that case it might be my understanding of IIS basic authentication
and how it (should) works.

This is what I''m currently doing:

IIS Manager domain.com - private folder properties Directory
Security Authentication and access control - Edit
Unchecked "Enable anonymous access"
Checked only "Basic authentication (password is sent in clear text)"

Then to assign the user:

IIS Manager domain.com - private folder permissions Assign full
control to "test" user
(I''m assigning full control at present to try and establish where the
problem lies)

Are you running PHP as a CGI or a isapi module?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================


这篇关于IIS上的PHP具有基本身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆