IIS 8不会运行PHP? [英] IIS 8 Wont run PHP?

查看:705
本文介绍了IIS 8不会运行PHP?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows Server 2012上遇到了IIS 8.0的权限问题,所以我决定删除&重新添加角色以尝试修复它。

I was having permission issues with IIS 8.0 on my Windows Server 2012 box, so I decided to remove & re-add the role in an attempt to fix it.

这似乎修复了我的权限问题,但现在我的PHP无法正常工作!
我在尝试访问 .php 文件时出现此错误

This seems to have fixed my permission problems, but now my PHP wont work! I get this error when trying to access a .php file


HTTP错误404.3 - 未找到

HTTP Error 404.3 - Not Found

由于扩展配置,无法提供您请求的页面。
如果页面是脚本,请添加处理程序。如果要下载该文件,请添加一个MIME映射。

The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.

显然我需要在这里添加一个处理程序给其中一个我的php安装文件夹中的文件(我使用Web应用程序管理器安装的东西),但我不知道从哪里添加处理程序?我知道从哪里添加MIME地图,但显然不能解决这个问题。

Obviously what I need to do here is add a handler to one of the files in my php install folder (which I installed using the web app manager thing) but I don't know where I add a handler from? I know where to add MIME maps from but obviously that isn't going to solve this.

更新:所以我按照其中一个答案它将我链接到PHP站点,按照它所说的那样,似乎已经修复了PHP没有运行的问题,但现在已经开启了一整套新的蠕虫病毒。我得到相同的访问被拒绝。像以前一样错误!即使我将文件扩展名更改为.html,看来我的网站也没有指向默认文档,因为当我访问www.mysite.co.uk时,我收到错误,但如果我去www.mysite.co。 uk / index.php,它运行正常!我的默认文档中有一个index.php条目和一个index.html,并且在根目录上的PHP安装

UPDATE: So I followed one of the answers which linked me to the PHP site, followed what it said and that seems to have fixed the PHP no running problem, but now thats opened a whole new can of worms. I'm getting the same Access is denied. error as before! even when i change file extensions to .html, it appears my site isnt directing to the default document, as when i go to www.mysite.co.uk, i get the error, but if i go to www.mysite.co.uk/index.php, it works fine! i have a index.php entry in my default documents, and a index.html, and neither seem to be working after the PHP install

权限完全后似乎都没有工作控制到,管理员,我的用户帐户,'网络服务'和'系统',只是要注意,我无法让网站工作,而无需为我的用户帐户和密码设置'connect as'选项,这就是它的内容用来访问文件。

permission on the root directory are full control to, Administrator, My user account, 'NETWORK SERVICE' and 'SYSTEM', just to note, i couldnt get the site to work at all without setting the 'connect as' option to my user account and password, so thats what its using to access the files.

推荐答案

我认为这可以帮到你;

I think this may help you;

http://php.net/manual/en/install.windows.iis7.php

对于iis7及以上版本,请告诉我是否无效,我会深入挖掘。

It says for iis7 and above, let me know if doesn't work and I'll dig deeper.

过程是;

1 - 在php.ini中配置CGI和FastCGI设置,例如

1 - Configure CGI- and FastCGI settings in your php.ini such as

Fastcgi.impersonate = 1
fastcgi.logging = 0
cgi.fix_pathinfo = 1
cgi.force_redirect = 0

2 - 然后在Windows中键入 inetmgr 进入运行下的运行开始菜单。

2 - Then in Windows type inetmgr into run under the start menu.

3 - 在打开的窗口中选择连接树中的服务器节点。

3 - Select the server node in the window that opens which is in the connections tree.

4 - 在中央窗格中,称为功能视图,打开处理程序映射功能。

4 - In the central pane, known as the features view, openthe Handler Mappings feature.

5 - 在操作窗格中单击**添加模块映射...

5 - In the actions pane click **Add Module Mapping..."

6 - 使用这些详细信息填写空白;

6 - Use these details to fill in the blanks;

Request path: *.php
Module: FastCgiModule
Executable: C:\[path to php install]\php-cgi.exe
Name: PHP_via_FastCGI

7 - 点击请求限制,然后仅当请求映射到文件或文件夹时才配置映射以调用处理程序。

7 - Click request restrictions and then configure the mapping to invoke handler only if request is mapped to a file or folder.

8 - 在所有对话框上单击 okay 以保存配置。

8 - Click okay on all dialogues to save the config.

顶部的链接提供了更多信息on配置示例以及如何从命令行执行此操作。完成后,您应该重新启动IIS。

The link at the top provides further information on configuration examples and how to do this from the command line. You should restart IIS once you're done.

这篇关于IIS 8不会运行PHP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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