Connection configuration for MS SQL Server on PHP version 5.4

Source: Internet
Author: User

Toss for a long time, finally finally connected success!

Note: I use the phpstudy.

Configuration in php.ini:

This is the driver extension =php_sqlsrv in PHP. dllextension=php_pdo_sqlsrv.dll

Download install Microsoft SQL Server Native Client ODBC driver X64 (64-bit Win7 on my computer).

I am using the thinkphp framework, which is configured as follows:

<? PHP return Array (    ' url_model '                 =/  /  If your environment does not support pathinfo please set it to 3    ' db_type '   = '  sqlsrv ',    ' db_host '   = '  localhost ',    ' db_name '   = ' Northwind '  ,    ' Db_user ' + '  sa ',    ' db_pwd ' and '    = ', ' db_port ' = ' 1433 '  ,    ' Db_prefix ' = '  , '    app_autoload_path ' and ' @ '  . TagLib ',    ' app_group_list '            = '  home,admin ',    ' default_group '             = '  Home ',    ' app_group_mode '            =  1,    ' show_page_trace '           +  1// display debug information );

A simple test:

class extends action{    publicfunction  index () {        $Model  =   M (' Customers '), select ();         Var_dump $Model );    }   .....

PHP High version of the MSSQL support configuration is more complicated than 5.2 so simple,

Version 5.5, 5.6 failed to debug this method through, do not know what the reason.

Connection configuration for MS SQL Server on PHP version 5.4

Related Article

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.