当前位置:网站首页>PHP uses sqlserver
PHP uses sqlserver
2022-07-26 13:51:00 【Assemble geese geese geese】
1、 install ODBC Program
Official download address :Download ODBC Driver for SQL Server - ODBC Driver for SQL Server | Microsoft Docs
2、 download sqlsrv Extension files
Official download address :Download the Microsoft Drivers for PHP for SQL Server - PHP drivers for SQL Server | Microsoft Docs
3、 Move the version corresponding to the extension file to PHP Under the corresponding directory ext Catalog ;
4、 change PHP Configuration file for , Add extensions ,( With php7.4 For example )
extension=php_pdo_sqlsrv_74_ts_x64
extension=php_sqlsrv_74_ts_x64
5、 restart apache or nginx service
Pay attention to the release notes of the official documents , That is to use sqlserver Of php Drive and operating system and php Version related requirements
https://docs.microsoft.com/zh-cn/sql/connect/php/release-notes-php-sql-driver?view=sql-server-ver16#previous-releases
When you don't install ODBC The program may not be configured sqlsrv file , Will return to Microsoft official download ODBC Links or tips for sqlsrv Function undefined
After the above two things are done, you may encounter errors :
[08001] [Microsoft][SQL Server Native Client 11.0]TCP Provider : Because the target computer actively refuses , Unable to connect .\r\n (10061) (SQLDriverConnect); [08001]
[Microsoft][SQL Server Native Client 11.0] Login timeout expired (0); [08001]
[Microsoft][SQL Server Native Client 11.0] Invalid connection string attribute (0); [08001]
[Microsoft][SQL Server Native Client 11.0] And SQL Server A network related or instance specific error occurred while establishing the connection . Unable to find or access the server . Please check whether the instance name is correct and SQL Server Whether it is configured to allow remote connections .
Don't worry about this , It's just that there is a problem filling in values such as user name and password
In addition, it is probably the port number
because sqlserver Network configured tcp/ip The default port in is 1433
Let's see if the connection port in your code is 1433(127.0.1.1,1433), If you don't change the port number
In addition, there may be some port numbers that are not open .
Reference link :
https://blog.csdn.net/u012887346/article/details/124768262
https://blog.csdn.net/u010423663/article/details/125464776
https://docs.microsoft.com/zh-cn/sql/connect/php/release-notes-php-sql-driver?view=sql-server-ver16#previous-releases
边栏推荐
- Time complexity and space complexity
- Tdsql-c serverless: help start-ups achieve cost reduction and efficiency increase
- Synchronization mechanism of go (sync.mutex)
- Comparison between SIGMOD function and softmax function
- Codeforces Round #810 (Div. 2)【比赛记录】
- Basic sentence structure of English ----- origin
- ROS2学习(1)ROS2简述
- Brief introduction of reflection mechanism
- POM file details
- LCL three-phase PWM rectifier (inverter)
猜你喜欢

Uncover the secret of white hat: 100 billion black products on the Internet scare musk away

Frisbee, 2022 "black red" top stream

Photoshop(CC2020)未完

Win11+vs2019 configuration yolox
![[dark horse morning post] many apps under bytek have been taken off the shelves; The leakage of deoxidizer in three squirrels caused pregnant women to eat by mistake; CBA claimed 406million yuan from](/img/f6/03e39799db36c33a58127359aa2794.png)
[dark horse morning post] many apps under bytek have been taken off the shelves; The leakage of deoxidizer in three squirrels caused pregnant women to eat by mistake; CBA claimed 406million yuan from

Detailed explanation of factory mode

多态案例-制作饮品

Basic sentence structure of English ----- origin

Pytoch learning notes (I) installation and use of common functions

The serialization class in unity is in JSON format
随机推荐
一文学透MySQL表的创建和约束
飞盘,2022年“黑红”顶流
[collection of topics that C language learners must know 1] consolidate the foundation and steadily improve
Photoshop (cc2020) unfinished
Rotation of 2D conversion, transform origin of 2D conversion center point and scale of 2D conversion
Pytoch learning notes (II) the use of neural networks
.net6与英雄联盟邂逅之——根据官方LCU API制作游戏助手
Add a display horizontal line between idea methods
MySQL sets auto increment for existing primary keys
Videojs to canvas pause, play, switch video
向路由组件传递参数
The last time I heard about eBay, or the last time
With frequent data leakage and deletion events, how should enterprises build a security defense line?
Synchronization mechanism of go (sync.mutex)
"Intermediate and advanced test questions": what is the implementation principle of mvcc?
Oom caused by improper use of multithreading
[NOIP2003 普及组]栈
Share 44 JS problems, and half of them are masters
Mobile dual finger scaling event (native), e.originalevent.touches
Solve the problem that the remote host cannot connect to the MySQL database