iis 6 配置PHP

  网上不少这方面的资料,但大多过期了。对与目前以及以后的php 版本之前的安装方式已经无效。

  

1. 新版本的PHP5.3通过以往老方法已经不能在IIS上安装了,现在给出在IIS上安装PHP5.3以后版本的教程。

首先下载并安装IIS FastCGI,下载地址http://www.iis.net/1521/ItemPermalink.ashx

选择 x86的,Or, download x86,下载下来名称为 fcgisetup_1.5_rtw_x86.msi

下载IIS下的PHP,下载地址http://windows.php.net/download/,(注意IIS下要选择VC9的版本)解压到所需目录,该目录需要给予user读取运行权限,找到PHP安装目录下的php.ini-development并改名为php.ini文件,找到下面

 

[Date]
; Defines the default timezone used by the date functions
http://php.net/date.timezone
date.timezone = "PRC" ( 注意没有分号)

如果不改以上的date.timezone可能打开网页会提示500错误(我直接就改了,所以没有看到这个错误,感谢前人的探索!)

找到

; On windows:
; extension_dir ="ext"

改为

; On windows:

 extension_dir =  "E:\php5\ext"

目录根据自己情况定

 

要配置mysql修改如下:

查找下面三个文件去掉前面的分号“;”

;extension=php_mysql.dll

;extension=php_gd2.dll

;extension=php_mbstring.dll

将mysql安装目录下bin目录中的 libmysql.dll复制到"c:\windows\system32"目录下;

将php-5.3.1\ext目录下的“php_gd2.dll”与“php_msql.dll”复制到“C:\WINDOWS\system32”目录下。

 

2.

右键“默认网站”

在”应用程序配置”中点击”添加”,”可执行文件”处点击浏览,选择C:\WINDOWS\system32\inetsrv\fcgiext.dll 

扩展文件名: .php

 

如果没法添加是因为你没有停止网站

3. 

 

打开FastCGI配置文件C:\WINDOWS\system32\inetsrv\fcgiext.ini,在最后[Types]修改为这样的样式

[Types]

php=PHP

[PHP]

ExePath=c:\php5\php-cgi.exe

 

在IIS默认文档中添加index.php,重启IIS在网站中新建一个index.php文件
index.php 
<?php
phpinfo();
?>

posted @ 2012-06-26 17:23  水草肃  阅读(220)  评论(0编辑  收藏  举报