今天试了一下升级到PHP 5.4.45,但是却发现了不少问题。在以前PHP 5.2.X中,只需要使用php5isapi.dll的方式就可以,但在PHP 5.3以后却不再支持ISAPI模式了,也没有此文件。所以本文介绍使用FastCgi在IIS6来配置PHP 5.3以上的运行环境。
 

一、下载PHP 5.4.45

 
 
这里根据自己的情况下载对应的版本,我是IIS,这里下载 VC9 x86 Non Thread Safe 这个(文件名是 php-5.4.45-nts-Win32-VC9-x86.zip),如果你是apache的话就下载VC9 x86 Thread Safe这个(文件名是 php-5.4.45-Win32-VC9-x86.zip)。

 
另外从PHP5.5开始,已不支持xp和win2003上运行了,因此win2003上只能安装PHP5.4X的版本,这个大家需要注意了,不要再下载更高版本了。
 

二、下载FastCGI

 
 
有支持IIS6和IIS5.1的32位版本和64位版本,还有支持IIS7的,因为IIS7与IIS6差别比较大,所以对于IIS7以后再介绍吧,下载下来名称为 fcgisetup_1.5_rtw_x86.msi。
 

三、安装FastCgi

 
安装FastCgi没什么可介绍的,安装后会在 C:\WINDOWS\system32\inetsrv\ 目录下多出了5个文件fcgiconfig.js,fcgiext.dll,fcgiext.ini,fcgilicense.rtf,fcgireadme.htm 。
 
 
但是有一点要注意,就是系统要先安装VC9运行库才能正常运行,否则会报“FastCGI Error 14001 (0x800736b1)”之类的错误,文章最后面会提供下载地址。
 
 

四、配置FastCGI

 
打开FASTCGI配置文件 C:\WINDOWS\system32\inetsrv\fcgiext.ini ,在最后[Types]修改为这样的样式
 
[Types]
php=PHP
[PHP]
ExePath=D:\php\php-cgi.exe
 

五、开始安装PHP环境

 
解压 php-5.4.45-nts-Win32-VC9-x86.zip 压缩包到 d:\php,该目录需要给予user读取运行权限。
 
找到PHP安装目录下的 php.ini-production 并改名为 php.ini 文件(也有人使用 php.ini-development ),当然如果你怕有错可以先备份一下。
 
修改PHP.ini文件
 
找到
 
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
; date.timezone =
 
更改为
 
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = Asia/Shanghai
 
找到
 
; On windows:
; extension_dir = "ext"
 
改为
 
; On windows:
extension_dir = "ext"
 
查找extension=php_,去掉以下几个扩展前面的分号(基本的几项)。
 
extension=php_curl.dll
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_pdo_mysql.dll
extension=php_xmlrpc.dll
 
查找 short_open_tag = Off ,改成 On ,让其支持短标签(非必须)。
 
查找
 

; fastcgi.impersonate = 1

 
改为
 

fastcgi.impersonate = 1

 
查找
 

; cgi.fix_pathinfo = 1

 
改为
 

cgi.fix_pathinfo = 1

 
查找
 

;cgi.force_redirect = 1

 
改为
 

cgi.force_redirect = 0

 

六、配置IIS

 
(1)网站》属性》主目录》配置》添加
 
 
 
 
 
可执行文件填写C:\WINDOWS\system32\inetsrv\fcgiext.dll
 
扩展名填写.php。
 
动作->限制为GET,HEAD,POST。
 
(2)网站->属性->文档->添加默认内容index.php。这里全部配置好了,一定要把IIS服务重启一下。
 

七、测试

 
用文本写一段测试代码:
 

<?php

phpinfo();
?>
 
保存为index.php,名字随便取,只要后缀是.php就可以。把index.php放到根目录下,我这里是C:\Inetpub\wwwroot,然后在浏览器中输入http://localhost/index.php就可以得到返回的信息了。
 
 
八、若出现如同下面的错误,说明你的电脑没有安装VC9运行库 即VISUAL C++ 2008。
 
FastCGI Error  
The FastCGI Handler was unable to process the request.   
-------------------------------------------------------  
Error Details:
Error Number: 14001 (0x800736b1).
Error Description: ????????????????????????????
HTTP Error 500 - Server Error.
Internet Information Services (IIS)
 
Microsoft Visual C++ 2008 Redistributable Package (x86)
 

Windows server 2003+IIS6+PHP5.4.45环境搭建教程的更多相关文章

  1. Windows server 2003+IIS6+PHP5.3 以上的安装配置

    一.安装好IIS 具体安装方法可查看:http://down.chinaz.com/server/201102/11_1.htm. 二.下载并安装IIS FastCGI 下载地址:http://www ...

  2. Windows Server 2003 IIS6.0+PHP5(FastCGI)+MySQL5环境搭建教程

    准备篇 一.环境说明: 操作系统:Windows Server 2003 SP2 32位 PHP版本:php 5.3.14(我用的php 5.3.10安装版) MySQL版本:MySQL5.5.25 ...

  3. Win2008 R2 IIS7.5+PHP5(FastCGI)+MySQL5环境搭建教程

    现在很多朋友想尝试win2008 r2来跑web服务器,跟win2003相比界面差别有点大,有些人可能不太习惯,不过以后是趋势啊,这里简单分享下,方便需要的朋友 准备篇 一.环境说明: 操作系统:Wi ...

  4. 搭建 Windows Server 2003 + IIS6.0 + FastCGI + PHP5.3.29 + MySQL5.5.38 + Memcached1.2.6

    一.下载相关软件: 1.VC9运行库 即VISUAL C++ 2008 自PHP5.3.0开始,PHP提供VC2008编译版,需要安装VC++ 2008的运行库. [微软官方下载] http://ww ...

  5. Windows server 2003 + IIS6 搭建Asp.net MVC运行环境

    安装.Net Framework4.0.下载地址:http://www.microsoft.com/zh-cn/download/details.aspx?id=17718 安装WindowsServ ...

  6. Windows server 2003 + IIS6 搭建Asp.net MVC执行环境

    安装.Net Framework4.0. 下载地址: http://www.microsoft.com/zh-cn/download/details.aspx?id=17718  安装WindowsS ...

  7. C#创建IIS站点及相应的应用程序池,支持IIS6.0+Windows Server 2003. 使用Builder设计模式

    测试项目结构: PS:IIS6UtilsBuilder, IIS7UtilsBuilder,IISUtilsBuilder以及IISDirector为Builder设计模式实现的核心代码.Progra ...

  8. Windows server 2003常用设置

    1.禁用配置服务器向导   由于不需要服务器设置功能,首先我们先禁止“配置你的服务器”(Manage   Your   Server)向导的出现,你可以在控制面板(Control   Panel)   ...

  9. Windows Server 2003搭建邮件服务器

    Windows Server 2003搭建邮件服务器 由于Windows Server 2003默认是没有安装我们搭建邮件服务器所需要的POP3和SMTP服务的,因此需要我们自己来安装.方法如下: 1 ...

随机推荐

  1. 应用安全 - Web安全 - 远程控制管理工具 - 汇总

    菜刀 蚁剑 冰蝎 DarkCommet ADT windows/upexec/reverse_tcp set PEXEC xxx

  2. MySql 性能优化之 Explain

    MySQL 之 Explain 输出分析 背景 前面的文章写过 MySQL 的事务和锁,这篇文章我们来聊聊 MySQL 的 Explain,估计大家在工作或者面试中多多少少都会接触过这个.可能工作中实 ...

  3. ConfigurationManager.ConnectionStrings 属性

    public static ConnectionStringSettingsCollection ConnectionStrings { get; } App.config <?xml vers ...

  4. Windows 运行时加载动态库

    下面是一个运行时加载nvcuda.dll,并检测当前驱动版本最大支持的CUDA版本的例子. #include "cuda.h" #include <stdio.h> # ...

  5. sudo pip install -i http://pypi.douban.com/simple/ --trusted-host=pypi.douban.com/simple ipython

    sudo pip install -i http://pypi.douban.com/simple/ --trusted-host=pypi.douban.com/simple ipython

  6. 区间动态规划 矩阵连乘 Medium

    The multiplication puzzle is played with a row of cards, each containing a single positive integer. ...

  7. npm publish 失败可能的原因记录

    npm 发布个人包时,遇到不少坑,总结如下(可能不全): 1.npm版本过低,处理:npm install -g npm update 2.可能权限原因,处理:npm publish --access ...

  8. javascript 输入框监听事件

    <div class="coupon-exchange clearfix"> <div class="code-input"> < ...

  9. [七月挑选]树莓派Raspberrypi上配置Git

    title: 树莓派Raspberrypi上配置Git 树莓派Raspberrypi上配置Git. 开始 首先你得有一树莓派!!! 过程 查看自己树莓派的版本 pi@raspberrypi:~ $ u ...

  10. tensorflow 中 inter_op 和 intra_op

    [root@localhost custom-resnet-v2]# cat runme.sh #python demo_slim.py -h #python demo_slim.py --cpu_n ...