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