Unofficial Microsoft SQL Server Driver for PHP (sqlsrv)非官方的PHP SQL Server 驱动

原文 Unofficial Microsoft SQL Server Driver for PHP (sqlsrv)

Here are unofficial modified builds of Microsoft‘s sqlsrv and pdo_sqlsrv drivers for PHP, version 3.0, for:

  • PHP 5.6 for Windows Vista/2008 and above (32 and 64 bit)
  • PHP 5.5 for Windows Vista/2008 and above (32 and 64 bit)
  • PHP 5.3 and 5.4 for Windows XP/2003 and above (32 bit)
    Microsoft‘s
    version 3.0 driver does not run on XP/2003 because it has a hard-coded
    dependency on the SQL Server 2012 Native Client (ODBC driver), which
    will not install on XP.  To fix the problem I just had to allow the PHP
    driver to use an older version of the ODBC driver supported by XP.

Downloads

The latest drivers are exactly the same as Microsoft‘s, except:

  1. All known memory leak and memory exception bugs have been fixed *
  2. Column names can contain unicode characters
  3. The newest of any of these ODBC drivers is selected, depending on what‘s installed:
    1. SQL Server Native Client 12.0 (hasn‘t been invented as of June 2014!)
    2. SQL Server Native Client 11.0 (SQL Server 2012 ODBC driver)
    3. SQL Server Native Client 10.0 (SQL Server 2008/r2 ODBC driver)
    4. SQL Native Client (SQL Server 2005 ODBC driver)
  4. 64 bit versions included for PHP 5.5 and 5.6

Builds for PHP 5.3 and PHP 5.4 work on XP and above.

Builds for PHP 5.5+ only work on Windows Vista/2008 and above - PHP 5.5+
is built with the 2012 Visual C++ 11 compiler and it generates code
that works on Windows Vista and above.  I am comfortable with that - XP
has been superseded a long time ago, Windows 8.1 is absolutely great,
and don‘t forget that upgrading Windows also upgrades to a far better
web server in IIS 7.5 or 8.5.

It‘s never a good idea to look at the source code of things you like -
since I had to look, my new list of things to do includes writing a new
version of this driver.  It is a wrapper around the ODBC API, and has no
business making strict dependencies on any version of the SQL Server
Native Client.  It should even work with SQL Server 6, because there is
an ODBC driver for that too.  Furthermore, it‘s a pretty ugly bit of
code and every update is likely to introduce new bugs.  It‘s still a
better choice than using the PHP ODBC driver, as it‘s much faster in
returning data, it is multilingual (nchar and nvarchar), it supports the
majority of data types, and includes parameters.

* Sqlsrv changes
The sqlsrv driver has a fix to a bug found by Charles Durrant (http://sqlsrvphp.codeplex.com/workitem/22427)
which I too recently experienced when running PHP-32 on a 64 bit
server.  I noted Charles‘s post when he first reported the bug, but
tried my best to avoid working on the source code until I had to...
Charles saved me a huge amount of time, so thank you to him.  My fix is
different, I have repaired all of Microsoft‘s dodgy auto pointers and
completely rewritten the horrible function that caused the crash.  If
anyone uses these new builds and spots memory leaks or bugs due to these
changes, please let me know and I‘ll fix them within a day or two.

Microsoft‘s official downloads are here:

SQL Server Native Clients are here:

时间: 2024-11-02 15:55:03

Unofficial Microsoft SQL Server Driver for PHP (sqlsrv)非官方的PHP SQL Server 驱动的相关文章

连接SQLServer2005失败--[Microsoft][ODBC SQL Server Driver][DBNETLIB]一般性网络错误。请检查网络文档

连接SQLServer2005失败,错误信息: 错误类型:Microsoft OLE DB Provider for ODBC Drivers (0x80004005)[Microsoft][ODBC SQL Server Driver][DBNETLIB]一般性网络错误.请检查网络文档. 我的连接字符串是:driver={SQL Server};Server=192.168.10.139;database=TestFax;Uid=sa;pwd=xxxx; 奇怪的是,我将Server处写(loc

PowerDesigner反向数据库时遇到[Microsoft][ODBC SQL Server Driver][SQL Server]无法预定义语句。SQLSTATE = 37错误解决方法

逆向工程中,有时会出现如下错误 ... [Microsoft][ODBC SQL Server Driver][SQL Server]无法预定义语句 SQLSTATE = 37000 解决方案: 1.选择菜单栏中的Database -> Change Current DBMS ,给DBMS选择SQL Server2005. 2.重新配置ODBC连接,管理工具 -> 数据源ODBC -> 在用户DSN Tab选项中点添加 ->出现创建新数据源的选择框口,拖动滚动条到最下方,选择SQL

[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server 不存在或访问被拒绝

一般连接sql数据库,IP_connstr="driver={SQL Server}; server=127.0.0.1;database=数据库名字;uid=sa;pwd=密码" 这样写没错,一般情况下不会出错,但如果出现 “[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server 不存在或访问被拒绝” 其原因就是能从百度中搜索找到的,其中这个需要你注意: 其实很简单,把server=127.0.0.1的127.0.0.1改为 打

SQL Server Driver for PHP之sqlsrv相关函数

SQL Server Driver for PHP 包含以下函数: 函数 说明 sqlsrv_begin_transaction 开始事务. sqlsrv_cancel 取消语句:并放弃相应语句的所有未决结果. sqlsrv_client_info 提供有关客户端的信息. sqlsrv_close 关闭连接.释放与相应连接关联的所有资源. sqlsrv_commit 提交事务. sqlsrv_configure 更改错误处理和日志记录配置. sqlsrv_connect 创建一个连接,并将其打开

使用SQL Server Driver for PHP解决PHP连接MSSQL乱码的问题

原文 使用SQL Server Driver for PHP解决PHP连接MSSQL乱码的问题 最近帮客户写了一个.net商城网站的发布接口,大家都知道.net一般都使用MSSQL数据库,但鱼丸不会.net呀,没办法,只能使用PHP连接SQL Server,然后来发布商品数据.因为客户采集的英文网站,但是要求发布时翻译成德语,发布完了,结果发现标题内容这些地方有乱码,在网上找了大半天,也试了很多种方法,结果使用SQLSRV解决了问题! 官方网址:http://msdn.microsoft.com

Add Microsoft SQL JDBC driver to Maven(转)

from:http://claude.betancourt.us/add-microsoft-sql-jdbc-driver-to-maven/ Add Microsoft SQL JDBC driver to Maven March 13, 2012 Framework / How-To / Tutorials Maven does not directly support some libraries, like Microsoft's SQL Server JDBC. This tutor

[Oracle][ODBC SQL Server Driver][SQL Server]对象名 'RECOVER.HS_TRANSACTION_LOG' 无效(转)

原帖由 qingyun 于 2010-6-21 15:44 发表 在写pl/sql的时候,有个很重要的注意点:比如:begin  update  某个sqlserver的表@dblink名字 .....;  update 某个oracle的表...;end; 这段pl/sql执行会报错:错误信息是:-----------------------------------------------------------------执行失败:ORA-02054: 事务处理 2.12.27634 有问题

firedac odbc sql server driver连接占线导致另一个hstmt

出现这个错误,很可能是数据库出现了死锁. 解决方法:清理死锁. 附上MSSQL清理死锁的存储过程,出现死锁的时候执行此存储过程即可: SET QUOTED_IDENTIFIER ON GOSET ANSI_NULLS ON GO -- =============================================-- Author: <Author,,Name>-- Create date: <Create Date,,>-- Description: 清除死锁-- =

[转载]在SQL Server 中,如何实现DBF文件和SQL Server表之间的导入或者导出?

原来使用SQL Server 2000数据库,通过DTS工具很方便地在SQL Server和DBF文件之间进行数据的导入和导出,现在安装了SQL Server2005之后,发现其提供的“SQL Server导入导出向导”中的数据源没有原来的丰富,缺少对DBF文件的支持. 1.右击数据库,选择“任务”>“导入数据”,打开“SQL Server导入和导出向导”对话框.2.在“数据源”中选择Microsoft OLE DB Provider for Visual FoxPro,单击“属性”按钮,打开“