thinkphp connecting to a SQL Server database

Source: Internet
Author: User

Original: thinkphp connecting the SQL Server database

Personal experience, in the Internet to find a connection to the SQL Server database method, or is not good to find, most of them are copied a person, and this person's write not all, hehe, first introduce my method of connection. If you are using thinkphp connection, then the most important thing is the configuration problem.

My PHP version is 5.3, just say 5.3 of the way.

1, first to download

Php_pdo_sqlsrv_53_ts_vc9.dll

Php_sqlsrv_53_ts_vc9.dll

:http://share.weiyun.com/dc589fc41567ce6e3fb8b131ec1553ff

These two files

2, copy to the PHP directory under the EXT directory

3. Modify the php.ini file in PHP directory:

At the end of the document add

Extension=php_sqlsrv_53_ts_vc9.dll
Extension=php_pdo_sqlsrv_53_ts_vc9.dll

4. Then find

Mssql.secure_connection

Change the value to ON

Save php.ini File

5. Restart Apache

6. Open the thinkphp configuration file

Change Db_type to: sqlsrv

Fill in the correct database server address, user name, password, etc.

If your system is Windows 7 , you can connect to the SQL Server database properly after you have completed the above operation.

If your system is Windows, then you need to do the following:

Download:http://share.weiyun.com/1f7cec9841c3c7bc6ff511e98720a176

There are two files in it, one is 32 bits, the other is 64 bits.

To install their own corresponding

Then restart the computer, okay, now you can connect to the database

thinkphp connecting to a SQL Server database

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.