Home > Topics > Pagoda Panel > How to install sqlsrv extension in Pagoda Panel PHP7.3 under Centos7

How to install sqlsrv extension in Pagoda Panel PHP7.3 under Centos7

藏色散人
Release: 2021-04-23 16:10:00
forward
3377 people have browsed it

The following tutorial column of Pagoda Panel will introduce to you how to install the sqlsrv extension in Pagoda Panel PHP7.3 under Centos7. I hope it will be helpful to friends who need it!

Installing the sqlsrv extension in Pagoda Panel PHP7.3 under Centos7

Originally I chose php7.4, but after configuration, it kept prompting that the dynamic extension could not be loaded. Downgraded to php7.3.
After compiling and installing php7.3, do the following:
Join Microsoft’s source

curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/mssqlrelease.repo
Copy after login

You can find it at (https://packages.microsoft.com/config/rhel ), find the corresponding required version
Install the driver

#如果安装过,防止冲突可先卸载再安装
yum remove unixODBC

yum install msodbcsql mssql-tools unixODBC-devel
Copy after login

Download the pdo_sqlsrv expansion package, and unzip it

wget http://pecl.php.net/get/pdo_sqlsrv-5.6.1.tgz
tar -zxvf pdo_sqlsrv-5.6.1.tgz
cd pdo_sqlsrv-5.6.1
Copy after login

Use Corresponding php version of phpize

/www/server/php/73/bin/phpize
./configure --with-php-config=/www/server/php/73/bin/php-config
make && make install
Copy after login

Write extension

echo "extension = pdo_sqlsrv.so" >> /www/server/php/73/etc/php.ini
/etc/init.d/php-fpm-73 reload
Copy after login

Check whether it is successful

/www/server/php/73/bin/php -m|grep -i  sqlsrv
Copy after login

View all extensions

php -m
Copy after login

PS: Pay attention to your own PHP version. After installing PHP7.4 many times, it prompts that the dynamic extension cannot be loaded. I hope that successful experts can leave a comment.

The above is the detailed content of How to install sqlsrv extension in Pagoda Panel PHP7.3 under Centos7. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template