当前位置:网站首页>php7.3 centos7.9安装sqlserver扩展
php7.3 centos7.9安装sqlserver扩展
2022-06-30 15:47:00 【BookNoteY】
php7.3 centos7.9安装sqlserver扩展
安装sql server驱动(直接yum准备)
yum install msodbcsql mssql-tools unixODBC-devel
到php扩展官网选择 要按照的sqlsrv,pdo_sqlsrv版本
sqlsrv 版本选择:https://pecl.php.net/package/sqlsrv
pdo_sqlsrv 版本选择:https://pecl.php.net/package/pdo_sqlsrv
查看每个版本对应详情:https://pecl.php.net/package-changelog.php?package=sqlsrv&release=5.10.1
安装扩展 这里安装5.6.1
下载源码包 cd到你下载的位置
wget https://pecl.php.net/get/pdo_sqlsrv-5.6.1.tgz && wget https://pecl.php.net/get/sqlsrv-5.6.1.tgz
解压
tar -zxvf pdo_sqlsrv-5.6.1.tgz && tar -zxvf sqlsrv-5.6.1.tgz
编译安装
# pdo_sqlsrv
cd pdo_sqlsrv-5.6.1
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install
# pdo_sqlsrv
cd pdo_sqlsrv-5.6.1
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install
修改配置文件并重启php
vim /usr/local/php/etc/php.ini
#到后面加入两行,引入扩展文件
extension=sqlsrv.so
extension=pdo_sqlsrv.so
#重启fpm, 我这里用的lnmp
lnmp restart
不要忘记重启你的php或php-fpm
查看是否安装成功,一般上面没有报错应该都会成功
php -m |grep sqlsrv
存在则成功
番外篇
如果遇到这样的问题
In file included from/root/sqlsrv-5.6.1/shared/typedefs for linux.h:23:0
from /root/sqlsrv-5.6.1/shared/xplat winnls.h:24, from /root/sqlsrv-5.6.1/shared/FormattedPrint.h:24
from /root/sqlsrv-5.6.1/shared/core sqlsrv.h:41, from /root/sqlsrv-5.6.1/php solsrvint.h:25
from /root/sqlsrv-5.6.1/conn.cpp:24:
/root/sqlsrv-5.6.1/shared/xplat.h:30:17: fatal error: sql.h: No such file or directory#include <sql.h>
应该就是你没有安装sqlserver驱动就安装的扩展,编译时就会报错
安装第一步的驱动后重新编译就可以解决
边栏推荐
- Raft介绍
- Bc1.2 PD protocol
- Cloud XR, how to help industrial upgrading
- 【Verilog基础】关于Clock信号的一些概念总结(clock setup/hold、clock tree、clock skew、clock latency、clock transition..)
- What is the difference between real-time rendering and pre rendering
- 更多龙蜥自研特性!生产可用的 Anolis OS 8.6 正式发布
- 2022蓝桥杯国赛B组-费用报销-(线性dp|状态dp)
- 居家办公浅谈远程协助快速提效心得 | 社区征文
- Siyuan notes: can you provide shortcut keys for folding all titles on the page?
- RT-Thread 堆區大小設置
猜你喜欢

Hologres共享集群助力淘宝订阅极致精细化运营

go-zero微服务实战系列(八、如何处理每秒上万次的下单请求)
![[download attached] installation and use of penetration test artifact Nessus](/img/ef/b6a37497010a8320cf5a49a01c2dff.png)
[download attached] installation and use of penetration test artifact Nessus

Installing jupyter notebook under Anaconda

微信表情符号写入判决书,你发的OK、炸弹都可能成为“呈堂证供”
![Halcon knowledge: regional topics [07]](/img/18/680997127047fb24b0ee4f19d8f2c5.png)
Halcon knowledge: regional topics [07]

【Verilog基础】关于Clock信号的一些概念总结(clock setup/hold、clock tree、clock skew、clock latency、clock transition..)

Hundreds of lines of code to implement a JSON parser

什么是XR扩展现实,XR云串流平台有哪些

19:00 p.m. tonight, knowledge empowerment phase 2 live broadcast - control panel interface design of openharmony smart home project
随机推荐
Installing jupyter notebook under Anaconda
How to connect the Internet Reading Notes - Summary
AVIC UAV technology innovation board is listed: the fist product with a market value of 38.5 billion is pterodactyl UAV
What is XR extended reality and what are the XR cloud streaming platforms
有意思的鼠标指针交互探究
Three development trends of enterprise application viewed from the third technological revolution
Bidding announcement: Taizhou Unicom Oracle all in one machine and database maintenance service project in 2022
边缘计算平台如何助力物联网发展
After 15 years of working on 21 types of hardware, where is Google?
[BJDCTF2020]The mystery of ip|[CISCN2019 华东南赛区]Web11|SSTI注入
Interesting research on mouse pointer interaction
Hologres共享集群助力淘宝订阅极致精细化运营
flinkcdc如果监控的数据库为mongo就必须是集群版吗
Two methods for MySQL to open remote connection permission
Hundreds of lines of code to implement a JSON parser
牛客网:乘积为正数的最长连续子数组
实时渲染和预渲染有什么区别
今晚19:00知识赋能第2期直播丨OpenHarmony智能家居项目之控制面板界面设计
What is the difference between real-time rendering and pre rendering
构建适合组织的云原生可观测性能力