PHP5.3 configure mssql (sqlserver)

Source: Internet
Author: User
Recently, due to some security issues, we have to upgrade the original program to PHP5.3. I originally wanted to say that I could raise it without any pain, but I knew it only when I got started. If I used SQLServer, it would be very troublesome! After PHP5.3, SQL Server is no longer supported, because the micro-engine jumped down and did it! (For more information, see msdn. microsof.

Recently, due to some security issues, we have to upgrade the original program to PHP 5.3. I originally wanted to say that I could raise the bar without any pain, but I knew it only when I got started. If I used SQL Server, it would be very troublesome! Since PHP 5.3, SQL Server is no longer supported, because the micro-engine jumped down and did it! (Please refer to: http://msdn.microsof

Recently, due to some security issues, we have to upgrade the original program to PHP 5.3. I originally wanted to say that I could raise the bar without any pain, but I knew it only when I got started. If I used SQL Server, it would be very troublesome!

Since PHP 5.3, SQL Server is no longer supported, because the micro-engine jumped down and did it! (Please refer to: http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx)

In addition, the functions of the original mssql_xxx are no longer supported, and all functions are converted into functions of sqlsrv_xxx. Http://www.php.net/manual/en/book.sqlsrv.php)

The following describes my update Methods:

1. Microsoft Drivers 3.0 for PHP for SQL Server: http://www.microsoft.com/en-us/download/details.aspx? Id = 20098

SQLSRV20.EXE and SQLSRV30.EXE are available here. SQLSRV30.EXE supports SQL Server 2010. If you are using SQL Server 2008, just run SQLSRV20.EXE.

2. Installing SQLSRV for PHP

After the download is completed, all the DLL files are merged to the ext object under PHP. Then set php. ini.

In my settings, I use php_sqlsrv_53_nts_vc9.dll. The naming rules are as follows:

  • _ 53 _: PHP 5.3. If you use PHP 5.4, use the _ 54 _ DLL.
  • _ Nt _: Non-thread-safe. Because FastCGI is used, non-thread safe is used. If you use apache module or iis isapi mode, use the _ ts _ DLL.
  • _ Vc9 _: Use Microsfot Visual C ++ v9 Compiler.

In addition to this, if you use the PDO method to collect data, you must use a DLL with _ PDO.

3. Set PHP. ini

You only need to add extension = php_sqlsrv_53_nts_vc9.dll.

4. PHP Program

Because I use ADOdb Database into action Library for PHP, you only need to change the DB type from mssql to mssqlnative.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.