新增一台win2003 server系统的服务器。以前其他的服务器上使用php5.0/5.1,数据库是SQL Server 2000;本次则打算安装SQL Server 2005,php5.3.2;据了解,php5.3版本使用微软的FastCGI模式,这种模式和传统的CGI模式相比采用了更加合理的解析进程启动模 式,速度比CGI2倍;在PHP5.3以上的版本已经对ISAPI模式不支持。
在已经安装iis6ms sql server 2005后,整个安装过程是
1.安装FastCGI;
2.安装php5.3.2
3.安装SQL Server Driver for PHP 1.1驱动;
一、在服务器上安装FastCGI
  在服务器上打开下面网址运行Microsoft Web 平台安装程序:
www.microsoft/web/gallery/install.aspx?appsxml=&appid=PHP%3bPHP%3bPHP
 
    如图:勾选选web服务器/自定义/应用程序开发/FastCGI1.0,下一步直至FastCGI安装完成;
   
    有关FASTCGI的官方说明文档:
    www.iis/articles/view.aspx/IIS7/Hosting-Web-Applications/PHP/Configuring-FastCGI-Extension-for-IIS6-0-and-IIS5-?Page=1
二、安装php5.3.2
      下载网址:windows.php/downloads/releases/
      截图:
      我们下载这里目前所见的最新版本php-5.3.2-Win32-VC9-x86.msi 到服务器上,VC6用于apache,vc9用于 win2003 server iis等;熟悉php的程序员可以下载zip版自行配置;
      运行php-5.3.2-Win32-VC9-x86.msi 安装中出现对话框,选择安装目录C:\PHP,选 IIS FASTCGI;完成安装。
三、配置IIS支持PHP
    1.FACTCGI安装后在c:\windows\system32\inetsrv下有五个文件,其中有用的 是:fcgtext.dll,fcgitext.ini;打开FASTCGI配置文件fcgitext.ini,在最后[Types]修改为这样的样式:
    [Types]
php=PHP
[PHP]
ExePath=c:\
    2.打开IIS管理器,网站上点右键-属性-主目录-配置-添加fcgiext.dll为可执行文件,配置如下图
      经过上述步骤,已经完成了PHP5.3.2iis6上的安装;如果下载的是zip版,则需对php.ini文件进行配置;
      之后,在iis里默认文档添加php
四、安装SQL Server Driver for PHP 1.1驱动
    SQL Server Driver for PHP 1.1驱动支持SQL  Server 2005 SQL Server 2008,目前最新的下载地址是:
www.microsoft/downloads/details.aspx?displaylang=en&FamilyID=ccdf728b-1ea0-48a8-a84a-5052214caad9

系统环境:
Supported Operating Systems: Windows 2000 Service Pack 4; Windows 7; Windows Server 2003 Service Pack 2; Windows Server 2008; Windows Vista Service Pack 1; Windows XP Service Pack 3
PHP 5.2.4, or later. For more information about downloading and installing PHP, visit php/.
Microsoft SQL Server 2008 SQL Server Native Client. You can download SQL Server Native Client from a SQL Server 2008 Feature Pack.
Any edition of SQL Server 2005 or SQL Server 2008.
A Web server configured to run PHP.
    1.下载后文件名为SQLServerDriverForPHP11.EXE,解压如图:
php实例代码教程   
  2.拷贝驱动php_sqlsrv_53_ts_vc9.dll到相应的位置PHP目录下ext文件夹内;


3.配置的时候 若需要配置一个PHP的扩展,此扩展需要将相关的dll文件全部复制到PHP的扩展目录里面,然后通过修改php.ini来实现PHP的扩展,在 php.ini里面需要指明扩展路径,一般情况是在最末尾添加一行,所以修改php.ini实现扩展:

php.ini的一大 ;extension=**.dll格式里面添加一行,此部分位于以下注释下边一般:

; Windows Extensions
; Note that ODBC support is built in, so no dll is needed for it.
; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
; extension folders as well as the separate PECL DLL download (PHP 5).
; Be sure to appropriately set the extension_dir directive.

添加的一行内容为:
extension=php_sqlsrv_53_ts_vc9.dll

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。