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.
相关推荐
Windows2008 R2 IIS7.5+PHP5(FastCGI)+MySQL5环境
Windows Server 2012 R2 IIS8.5+PHP(FastCGI)+MySQL环境搭建教程
Windows 2008 R2 IIS7 以fastcgi方式配置 PHP,Zend,Mysql,PHPmyAdmin
windows2003 + IIS6.0 环境下以Fastcgi方式配置php .docx
主要介绍了Windows 2008 R2 下IIS7.5+PHP5.2环境配置(FastCgi设置),需要的朋友可以参考下
操作系统:Windows Server 2008 R2 PHP版本:php 5.4.4 MySQL版本:MySQL5.5.25 二、相关软件下载: 1、PHP下载地址: http://windows.php.net/downloads/releases/php-5.4.4-nts-Win32-VC9-x86.zip 2、MySQL下载...
windows Server 2008 R2 下面IIS7.5已经对fastcgi的支持有了很大改进,还在使用PHP-ISAPi模式的朋友可以试一下
由于微软已逐步开始重视PHP ON Windows的应用,相继推出了Microsoft Web Platform,PHP Manager等IIS平台工具,x86和x64系统均可使用,再也不用为在IIS上配置PHP而烦恼了,PHP Manager用途如下: *关联PHP和IIS *...
之前在Windows Server 2008中配置PHP的时候安装过一个FastCGI的安装文件,今天在Windows7中安装FastCGI时却告知版本不支持,后来查了一下,原来Windows Server 2008默认是IIS7.0,IIS7.0默认不自带FastCGI,所以需要...
用于IIS的FASTCGI模块安装包,版本1.5RC
windows server 2008是基于NT6 平台的新型操作系统,其对硬件性能的发挥比起其它NT...windows server 2008的IIS版本为7.0,包括fastcgi,安装十分方便。 打开“开始”菜单→“服务器管理”,出现服务器管理界面(图1)
PHP在IIS7下以FASTCGI运行!!!!!写了半晚上 集成了iis7.5\mysql\PHP5.2.13\zend\
需要在IIS6.0下配置PHP,由于php 5.3.3已经不再支持isapi配置了,因此需采用fastcgi方式配置
Windows 2008 R2下IIS7.5+PHP+Mysql+Zend+Fastcgi+Xcache+phpmyadminp+帝国备份完全配置简明版教程 前言 其实windows Server 2008和windows Server 2008 R2自带有环境搭配软件(通过这个软件可以选择自己需要搭配的...
主要介绍了Win2008 r2 IIS7.5出现FastCGI进程最近常常失败。请过一会再尝试此请求的解决方法,需要的朋友可以参考下
早就听说最新的Windows Server 2008+IIS下边跑PHP并不比Linux差很多,而且微软已经和ZEND合作,专门针对IIS推出了FastCGI的支持,并且在IIS7.0之后就将FastCGI集成在IIS中,还有PHP的配置工具PHP Manager,所以在...