当前位置:网站首页>PHP connecting to SQL Server
PHP connecting to SQL Server
2022-07-23 13:32:00 【wiscourper_】
One 、 Download the extension
sqlsrv,pdo-sqlsrv
see php edition 
Download the corresponding extension pdo_sqlsrv\sqlsrv
Pay attention to system support requirements System requirements
Two 、 Install the extensions
Unzip downloaded files
pdo_sqlsrv
# decompression
tar -zxvf pdo_sqlsrv-5.8.1.tgz
# Enter the unzipped directory
cd pdo_sqlsrv-5.8.1
# perform phpize
/www/server/php/74/bin/phpize
# perform ./configure, Configure the software to be installed , Check whether the current environment meets the dependency of the software to be installed
./configure --with-php-config=/www/server/php/74/bin/php-config
# Compile and install
make && make install
# If nothing else , Get the following similar content
# .... Omit other information ....
Installing shared extensions: /www/server/php/74/lib/php/extensions/no-debug-non-zts-20190902/
sqlsrv Installation and pdo_sqlsrv equally 3、 ... and 、php Extended configuration
stay php.ini Add
# Extended Directory
extension_dir = "/Applications/MAMP/bin/php/php7.4.2/lib/php/extensions/no-debug-non-zts-20190902/"
# expanded memory bank
extension=sqlsrv.so
extension=pdo_sqlsrv.soFour 、sql server Configuration manager configuration
1) Server port 1433 Internet development , Add a specified port to the firewall ( Such as 1433) Entry rules for
2)sql server Configuration manager

Turn on tcp/ip agreement .tcp/ip attribute , Listen to all , Enable
ip Address ,ipall Remove dynamic ports , Fill in the fixed port 1433

Corresponding version sql native client Turn on tcp

5、 ... and 、sqlserver The instance configuration
Set to allow remote connections

Security : Set mixed login mode
Security / Login name / Specific users , Right click -> attribute

6、 ... and 、 Download the corresponding version of odbc The driver ( Conduct sql server Connect the test )
边栏推荐
- 分类模型的评估
- Machine learning: Li Hang - statistical learning method (II) perceptron + code implementation (primitive + dual form)
- The unity model is displayed in front of the UI, and the UI behind it jitters
- Opencv image processing (Part 2): edge detection + template matching + Hough transform
- Shooting lesson 1-3: image Sprite
- Space shooting part 2-2: enemy spirit
- MySQL index transaction & JDBC programming
- [jzof] 08 next node of binary tree
- 国信证券软件开户是安全吗?信息会不会泄露?
- 倍福PLC和C#通过ADS通信传输String数组类型变量
猜你喜欢
随机推荐
Shooting lesson 1-01: Introduction
Day 11 notes
Knowledge map: basic concepts
JVM内存模型简介
软件测试岗位饱和了?自动化测试是新一代‘offer’技能
MySQL index transaction & JDBC programming
转行软件测试有学历要求吗?低于大专是真的没出路吗?
Day 10 notes
给1万帧视频做目标分割,显存占用还不到1.4GB | ECCV2022
MySQL的索引事务&&JDBC编程
[actf2020 freshman competition]backupfile 1
谈谈学习和工作——钱学森
Talk about study and work -- Qian Xuesen
Outlook tutorial, how to switch calendar views and create meetings in outlook?
第七天筆記
倍福PLC和C#通过ADS通信传输bool类型变量
Compilation and preprocessing
网易白帽子黑客训练营笔记(2)
-XX:+UseCGroupMemoryLimitForHeap 无法创建虚拟机问题
Course design - push box C (win form)








