注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

.

.

 
 
 

日志

 
 

Installing PHP on Windows 7  

2012-06-22 08:59:00|  分类: 软件使用 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |


Microsoft have released the first public beta for their upcoming Windows 7 operating system. To me it looks surprisingly similar to Vista (which is a good thing and a bad thing ;-)), so I thought that installing PHP on it should be easy, as well. Actually, it was really easy, but since yesterday two people indenpendently from each other asked me how to do it, I thought I'd write down the required steps.
First of all, you need PHP (obviously). Go to the PHP download page and grab the latest non-thread-safe ZIP archive for Windows. As of writing this, the package is called "PHP 5.2.8 Non-thread-safe zip package". Unzip the archive to a folder on your hard disk (I use C:\php5) and create a copy of php.ini-recommended (or php.ini-production in recent PHP versions) called php.ini. There, add the following configuration setting:

cgi.force_redirect = 0

This is the minimum setting you need to change to make PHP work with IIS. You may also want to use cgi.fix_pathinfo = 1, fastcgi.impersonate = 1, and set extension_dir appropriately.

Then it's time to install IIS. You need at least the "Business" version of Windows 7, but the currently available beta 1 is Windows 7 Ultimate anyway. Go to Start/Control Panel/Programs/Turn Windows Features on or off and check on the Internet Information Services entry. Activate the World Wide Web Services/Application Development Features/CGI node and also Web Management Tools/IIS Management Console (the latter not shown in the figure).

Installing PHP on Windows 7 - foxer - .
 

 

 

 

 

Now, start the IIS Management Console; just open up the start menu, enter inetmgr and hit Enter. There, navigate to the Sites/Default Web Site/Handler Mappings node and double-click on the "Handler Mappings" entry.

Installing PHP on Windows 7 - foxer - .


As a result of this, the Actions panel on the right hand side changes. You now see an option called Add Module Mapping. Clicking on it opens up a dialog which you fill out as you can see in the following figure (you may need to adapt the path used to your local system).

Installing PHP on Windows 7 - foxer - .


If you do not see the FastCgiModule entry, you probably forgot to check the CGI node when installing IIS. Otherwise, close the Add Module Mapping dialog by clicking on OK. You need to confirm that you want to create a FastCGI application; click Yes.

Installing PHP on Windows 7 - foxer - .


Finally, create a .php script and put it in the root folder of the IIS site (by default C:\Inetpub\wwwroot; note that you may need additional rights to write into that directory), e.g. phpinfo.php with a simple phpinfo() call in it. Call this script using http://localhost/phpinfo.php, and you are done!

Installing PHP on Windows 7 - foxer - .
  评论这张
 
阅读(453)| 评论(0)
推荐

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017