With PHP being such a popular programming language for the web, it is important to understand how we can leverage our windows web server to run php. Below I will demonstrate how to install PHP 5.4 onto my brand new IIS7 web server. This server is running Windows 2008 r2 standard edition. A couple of disclaimers before I get started with the basic guide: You will need to adjust the paths in this guide suitable to your environment, I am using C: for my default website and S: (Secondary) drive for my program files (aka php installation). You will also need to make sure that you have the appropriate C++ runtime environment on your operating system. This is a fairly standard requirement so it is not included in this guide. Lastly, if you run into any problems or have question please feel free to reply to this thread or create your own and I will be more than happy to help you figure out what's going on (in my experience if you follow this guide and something isn't working it's a permission problem, or a php.ini configuration problem)
- The first step to making sure you can use PHP on your IIS server it to make sure you have CGI enabled. This can be done from the Server Manager under the Roles section.
- Next lets head out to [url="http://php.net/downloads.php
- and select the Windows {Version} binaries and source link.
- Next make sure you download the "Non Thread Safe" zip file of the version you want. You may also notice that it says VC9 x86, this indicates that you will need the x86 version of the c++ 2008 package on your machine in order for php to run.
- You will then be presented with some sort of download menu, if your using a browser that supports it just go ahead and open the zip file.
- After you have the zip file opened go ahead and select "Extract all files" near the top left corner of the window.
- Now extract these files to wherever you want your php installation to be located. For me I have this on a secondary drive under Program Files. Following the extraction go ahead and open up that folder as we have some work to do in that directory before we're done.
- In your PHP installation directory copy your php.ini-production (or development depending on what kind of sites you are putting up on this box).
- Then paste this file back in and rename it to be "php.ini"
- In your php.ini file make sure you have the following set:
open_basedir ={YOUR IIS WEBSITES PATH HERE} cgi.fix_pathinfo=1 fastcgi.impersonate=1
- After this set up your extensions you wish to have enabled and configure the rest of your php.ini file to your liking. Save and close the file.
- Next Open up the Internet Information Services (IIS) Manager.
- Select the "Handler Mappings" for your server
- Then click the "Add Module Mapping..." found in the top right corner of the Handler Mappings screen.
- Then fill in the following information and click OK:
Request path:*.php
FastCgiModule
{THE LOCATION OF YOUR PHP INSTALLATION}\php-cgi.exe
PHP via FastCGI
- After you click OK you will be prompted: "Do you want to create a FastCGI application for this executable? Click 'Yes' to add the entry to the FastCGI collection and to enable this executable to run as a FastCGI application." to which you should click "Yes".
- At this point you should have php running on your IIS server. To test, create a file called phpinfo.php in your default website directory (default is C:\inetpub\wwwroot\) and put the following code in the file and save it.
<?php phpinfo();?>
- After you have added that file open a web browser on the server and go to [url="http://localhost/phpinfo.php
- and you should see your php information if php is working properly. If not revisit the steps above and try and find what you might have missed.
相关推荐
### Windows Server 2008 R2 下 IIS 7.5 + PHP 5 (FastCGI) + MySQL 5 环境搭建详解 #### 一、环境配置概述 在构建开发或生产环境中,一个稳定的后端环境至关重要。本文档将详细介绍如何在 **Windows Server 2008 ...
### Windows Server 2012 R2 IIS8.5 + PHP (FastCGI) + MySQL 环境搭建详解 #### 一、环境说明与准备 **操作系统**: Windows Server 2012 R2 **PHP版本**: php5.5.8 **MySQL版本**: MySQL5.6.15 为了确保搭建...
Windows 2008 R2 自带IIS 7.5与FastCGI组件,无需额外安装FastCGI。在安装过程中,只需勾选CGI模块即可自动包含FastCGI,简化了配置过程。与IIS 6.0相比,这是一个很大的改进。 #### 第三步:安装MySQL 5.5.29 ...
这个版本适用于IIS 7.5,是微软服务器操作系统Windows Server 2008 R2的核心组件。IIS 7.5是一个功能强大的Web服务器,而PHP Manager则为在该平台上运行PHP应用程序提供了便利。通过PHP Manager,你可以: 1. **...
- **FastCGI支持**:IIS 7.5 支持FastCGI,能更好地运行PHP等脚本语言,实现与.NET平台的共存。 - **应用程序池**:每个.NET应用程序可以配置在独立的应用程序池中运行,这样可以避免一个应用的错误影响到其他应用...
### Windows Server 2012 R2 下配置 PHP7 + Nginx1.1 环境 在本文中,我们将详细介绍如何在 Windows Server 2012 R2 操作系统上配置 PHP7 和 Nginx1.1 的运行环境。这种组合常用于搭建高效的 Web 应用程序服务器,...
在构建Web服务环境中,Windows Server R2 2012结合IIS(Internet Information Services)、PHP和MySQL是一个常见的选择,尤其对于那些需要运行基于PHP的Web应用程序,如ThinkPHP框架的项目。本教程将深入讲解如何在...
Windows 2003 + IIS 6.0 环境下以 FastCGI 方式配置 PHP 在 Windows 2003 + IIS 6.0 环境下,以 FastCGI 方式配置 PHP 5.3.3 需要经过四个步骤:IIS 6.0 环境配置、下载 PHP 5.3.3、配置 PHP 和下载安装 Microsoft ...
文章通过介绍利用PHP Manager for IIS在Windows Server 2008 R2和IIS7.5环境下安装多版本PHP的步骤,不仅提供了操作流程,而且讲解了如何简化PHP的配置和管理。这为在IIS上进行PHP开发的用户提供了极大的便利,并且...
1. IIS版本与FastCGI的关系:在Windows Server 2008中,默认安装的是IIS 7.0,它并不自带FastCGI组件,因此需要单独安装FastCGI模块。而Windows 7中的IIS版本是7.5,该版本的IIS集成了FastCGI,无需额外安装,只需...
【标题】:“IIS7.5 学习笔记(一)IIS 7.5 新特性” 【描述】:这篇学习笔记主要介绍了IIS(Internet Information Services)7.5版本的一些重要新特性,作者通过博客分享了他在研究过程中的理解和实践,提供了宝贵...
IIS7.5 PHP5.3.10Zend Guard Loader配置 IIS7.5 是微软公司开发的Web服务器软件,PHP 是一种流行的开源服务器端脚本语言,而 Zend Guard Loader 是一个 PHP 加载器,用于加载 Zend Guard 加密后的 PHP 代码。下面是...
在Windows 2008 R2操作系统中,IIS7(Internet Information Services 7)是微软提供的Web服务器,用于托管各种Web应用程序。本教程将详细介绍如何以FastCGI(Fast Common Gateway Interface)方式配置PHP、Zend优化...
Windows Server 2008 R2下配置IIS7.5与PHP5.2环境是服务器搭建和网站部署中的一个基础工作。IIS(Internet Information Services)是微软公司推出的一款高效且功能强大的Web服务器软件,而PHP(Hypertext ...
Windows+IIS 环境下以 Fastcgi 方式配置 PHP 5.3.3 的方法 在 IIS 6.0 环境下配置 PHP,需要使用 Fastcgi 方式配置,因为 PHP 5.3.3 已经不再支持 ISAPI 配置。下面是配置的详细步骤: 步骤 1:IIS 6.0 环境配置 ...