【RHEL8.3安装LNMP并配置freetds连接MSSQL】
1.1.安装MYSQL(安装LNMP前置条件):
rpm -ivh mysql-community-client-8.3.0-1.el8.x86_64.rpm
rpm -ivh mysql-community-common-8.3.0-1.el8.x86_64.rpm
rpm -ivh mysql-community-icu-data-files-8.3.0-1.el8.x86_64.rpm
rpm -ivh mysql-community-libs-8.3.0-1.el8.x86_64.rpm
rpm -ivh mysql-community-server-8.3.0-1.el8.x86_64.rpm
链接: https://pan.baidu.com/s/1Es9_FmZPcD2hbMvPCYt44g?pwd=svqu 提取码: svqu 复制这段内容后打开百度网盘手机App,操作更方便哦
1.2.安装LNMP:
tar -xzvf lnmp2.0-full.tar.gz;cd lnmp2.0-full;bash install.sh lnmp;根据配置精准选择安装组件...
2.1配置PHP支持freetds连接MSSQL:(转自——http://www.csuper.cn/?id=604)
./configure --prefix=/LNMP/freetds --with-tdsver=8.0 --enable-msdblib --enable-dbmfix --with-gnu-ld --enable-shared --enable-static
make && make install
tsql -C
vi /LNMP/freetds/etc/freetds.conf
[mssql_info]
host = 10.233.233.8
port = 1433
tds version = 7.1
测试链接
tsql -H ip -p 1433 -U sa -P pw
下载对应版本的freetds:Version: freetds v1.00.47,VS
https://www.freetds.org/userguide/ChoosingTdsProtocol.html
2.2配置php支持mssql
cd /LNMP/lnmp2.0-full/src/php-5.3.29/ext/mssql (这步很关键,进入LNMP对应版本的php src目录,去编译mssql.so)
/usr/bin/phpize ./configure --with-php-config=/usr/local/php/bin/php-config --with-mssql=/LNMP/freetds
./configure --with-php-config="/usr/