当前位置:网站首页>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
边栏推荐
- 消息的订阅和发布
- Pytorch学习笔记(三)模型的使用、修改、训练(CPU/GPU)及验证
- 云智技术论坛工业专场 明天见!
- See you tomorrow at the industrial session of cloud intelligence technology forum!
- [beauty of open source] nanomsg (2): req/rep mode
- Familiarize you with the "phone book" of cloud network: DNS
- JUC summary
- Photoshop(CC2020)未完
- Concept and handling of exceptions
- Code cloud, which officially supports the pages function, can deploy static pages
猜你喜欢

WPS凭什么拒绝广告?

历时15年、拥有5亿用户的飞信,彻底死了
![[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

Multi objective optimization series 1 --- explanation of non dominated sorting function of NSGA2

DP sword finger offer II 100. sum of minimum paths in triangle

How to write the introduction of GIS method journals and papers?

Unicorn, valued at $1.5 billion, was suddenly laid off, and another track was cold?

LCL three-phase PWM rectifier (inverter)

Analysis on the current situation and optimization strategy of customer experience management in banking industry

Ultimate doll 2.0 | cloud native delivery package
随机推荐
Use the requests library to crawl web pages
【黑马早报】字节旗下多款APP下架;三只松鼠脱氧剂泄露致孕妇误食;CBA公司向B站索赔4.06亿;马斯克否认与谷歌创始人妻子有婚外情...
「中高级试题」:MVCC实现原理是什么?
"Intermediate and advanced test questions": what is the implementation principle of mvcc?
redis学习笔记
421. 数组中两个数的最大异或值
How to remove black edges from hyperimage images (two methods)
Zhou Wei: look for non consensual investment opportunities to accompany the founding team that delays satisfaction
Mobile dual finger scaling event (native), e.originalevent.touches
Latest battle report: Ten certifications and five best practices
JS download files, filesaver.js export txt and Excel files
Add a display horizontal line between idea methods
JSON data transfer parameters & date type parameter transfer
IDEA(warning)No artifacts configured
从标注好的xml文件中截取坐标点(人脸框四个点坐标)人脸图像并保存在指定文件夹
Win11+vs2019 configuration yolox
Ros2 learning (1) introduction to ros2
[turn] judge the relationship between two geometries in ArcGIS
Intercept the coordinate points (four point coordinates of the face frame) face image from the marked XML file and save it in the specified folder
Uncover the secret of white hat: 100 billion black products on the Internet scare musk away