如何使用PHP 5.3使mssql工作? [英] How to get mssql work with PHP 5.3?

查看:122
本文介绍了如何使用PHP 5.3使mssql工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我升级到PHP 5.3,并注意到缺少php_mssql.dll。谷歌搜索之后,似乎5.3已经退出了对mssql的支持。所以我从微软下载驱动程序,但我似乎无法让它工作。

I upgraded to PHP 5.3, and noticed that php_mssql.dll is missing. After googling a bit, it seems that 5.3 has dropped support for mssql. So I downloaded the drivers from microsoft, but I can't seem to get it to work.

我在Windows上。在PHP 5.3的ext目录中解压缩文件后,需要做些什么?

I am on windows. What do I need to do, after I unzip the files in the ext directory of my PHP 5.3?

推荐答案

引用 http://php.net/manual/en/intro.mssql.php


MSSQL扩展名在Windows 5.3或更高版本的Windows上不再可用。
可从Microsoft获得MS SQL的替代驱动程序SQLSRV:» http:// msdn。 microsoft.com/en-us/sqlserver/ff657782.aspx

下载完成后,请按照此页面的说明进行操作:

Once you downloaded that, follow the instructions at this page:

简而言之:


您的PHP扩展目录中的驱动程序文件。

修改php.ini文件以包含驱动程序。例如:

Put the driver file in your PHP extension directory.
Modify the php.ini file to include the driver. For example:

extension=php_sqlsrv_53_nts_vc9.dll  

重新启动Web服务器。

Restart the Web server.

另请参阅(从该页复制)

See Also (copied from that page)

  • System Requirements (Microsoft Drivers for PHP for SQL Server)
  • Getting Started
  • Programming Guide
  • SQLSRV Driver API Reference (Microsoft Drivers for PHP for SQL Server)

SQLSRV扩展的PHP手册位于 http://php.net/manual /en/sqlsrv.installation.php ,并提供以下安装:

The PHP Manual for the SQLSRV extension is located at http://php.net/manual/en/sqlsrv.installation.php and offers the following for Installation:


通过添加适当的DLL可以启用SQLSRV扩展文件到您的PHP扩展目录和php.ini fi的相应条目乐。 SQLSRV下载附带几个驱动程序文件。您使用哪个驱动程序文件将取决于3个因素:您正在使用的PHP版本,无论您使用线程安全还是非线程安全的PHP,以及您的PHP安装是否使用VC6或VC9编译器编译。例如,如果您运行PHP 5.3,则使用非线程安全的PHP,并且您的PHP安装是使用VC9编译器编译的,那么您应该使用php_sqlsrv_53_nts_vc9.dll文件。 (如果您使用IIS作为Web服务器,则应使用与VC9编译器编译的非线程安全版本)。如果您运行PHP 5.2,则使用线程安全的PHP,并且您的PHP安装是使用VC6编译器编译的,则应使用php_sqlsrv_52_ts_vc6.dll文件。

The SQLSRV extension is enabled by adding appropriate DLL file to your PHP extension directory and the corresponding entry to the php.ini file. The SQLSRV download comes with several driver files. Which driver file you use will depend on 3 factors: the PHP version you are using, whether you are using thread-safe or non-thread-safe PHP, and whether your PHP installation was compiled with the VC6 or VC9 compiler. For example, if you are running PHP 5.3, you are using non-thread-safe PHP, and your PHP installation was compiled with the VC9 compiler, you should use the php_sqlsrv_53_nts_vc9.dll file. (You should use a non-thread-safe version compiled with the VC9 compiler if you are using IIS as your web server). If you are running PHP 5.2, you are using thread-safe PHP, and your PHP installation was compiled with the VC6 compiler, you should use the php_sqlsrv_52_ts_vc6.dll file.

驱动程序也可以用于PDO

这篇关于如何使用PHP 5.3使mssql工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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