IIS7上的PHP,支持(PDO)MS-SQL [英] PHP on IIS7 with (PDO) MS-SQL support

查看:190
本文介绍了IIS7上的PHP,支持(PDO)MS-SQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行IIS 7 Windows服务器,我的phpinfo配置命令的相关部分目前报告此:

I'm running an IIS 7 windows server and a relevant part of my phpinfo's configure command currently reports this:


cscript / nologo configure.js ...... - without-mssql
--without-pdo-mssql - without-pi3web...... - with-mcrypt = static

cscript /nologo configure.js ...... "--without-mssql" "--without-pdo-mssql" "--without-pi3web" ...... "--with-mcrypt=static"

我需要对我的服务器做什么才能看到上面的with-mssql,而不是看到没有-mssql ?

What do I need to do to my server so that I can see the with-mssql above as opposed to seeing without-mssql?

我曾被告知要重新编译PHP。这就是降压停止的地方。因为这个PHP附带了IIS安装,所以我们以前从不需要编译PHP。重新编译...是命令行的事情吗?

I was once told to recompile PHP. That's where the buck stopped. Cause this PHP came with IIS install so we never needed to compile PHP before. Re-compiling... is that a command line thing?

推荐答案

PHP不再提供PHP SQL Server支持和扩展。要将PHP与SQL Server连接,您需要用于SQL Server的PHP的Microsoft驱动程序

Microsoft SQL Server support and extensions are not shipped with PHP anymore. To connect PHP with SQL Server you need Microsoft Drivers for PHP for SQL Server:


PHP for SQL Server的Microsoft驱动程序是PHP 5扩展,
提供对SQL Server 2005及更高版本(包括$)的数据访问b $ b SQL Azure。

The Microsoft Drivers for PHP for SQL Server is a PHP 5 extension that provides data access to SQL Server 2005 and later versions including SQL Azure.

驱动程序的下载页面列出了四个版本可供选择。请参阅系统要求页面,以确定您需要的版本。 您必须为您的操作系统+ SQL Server + PHP版本组合安装正确的驱动程序

The download page for drivers lists four versions to choose from. Consult the System Requirements page in order to determine which version you need. You must install the correct driver for your Operating System+SQL Server+PHP version combination.

您还需要其中一个,具体取决于哪个您选择的驱动程序(这些必须单独安装):

You will also need one of these depending on which driver you choose (these must be installed separately):


  • SQL Server Native Client

  • Microsoft ODBC SQL Server的驱动程序11

安装程序只是提取指定位置的文件。您必须将文件转到PHP扩展目录。这些文件是PHP扩展。文件名表示:

The installer simply extracts the files in the specified location. You must the files to PHP extensions directory. The files are PHP extensions. The file names indicate:


  • nts / ts - 应与非线程安全/线程安全的PHP版本

  • 54/55/56 ... - 应与PHP 5.4版一起使用, 5.5,5.6,...

  • sqlsrv / pdo_sqlsrv - 提供程序界面/ PDO界面

  • nts/ts -- should be used with non thread safe/thread safe version of PHP
  • 54/55/56... -- should be used with PHP version 5.4, 5.5, 5.6, ...
  • sqlsrv/pdo_sqlsrv -- provides procedural interface/PDO interface

php.ini 文件中启用扩展,确保线程安全性和PHP版本匹配。

Enable the extensions in php.ini file making sure that thread safetyness and PHP versions match.

检查phpinfo以查看是否加载了扩展名。测试 sqlsrv_connect(servername)新PDO(sqlsrv:server = servername)以确保扩展名正在工作。

Check phpinfo to see if extensions are loaded. Test sqlsrv_connect("servername") and new PDO("sqlsrv:server=servername") to make sure the extensions are working.

这篇关于IIS7上的PHP,支持(PDO)MS-SQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆