从 Redhat 配置 php 以连接到 MS SQL 服务器
configure php from Redhat to connect to MS SQL Server
我正在尝试使用 php56 在 Redhat 服务器上部署 Moodle LMS,我想通过 freetds 和 php-mssql 将它连接到另一个远程 MS SQL 服务器,如何一起配置它们以便能够将 Moodle LMS 连接到数据库?
假设您安装了所有需要的包(php-mssql 和 freetds)。
您必须像这样在 /etc/freetds.conf 中添加一个条目:
[mydb]
host = 10.0.0.199
port = 1433
tds version = 8.0
client charset = UTF-8
text size = 20971520
重启httpd(服务httpd重启)
然后在 moodle 中将 db name 设置为 mydb,一切都会起作用。
可能你将不得不 set/disable selinux for moodle。以这种方式临时执行此操作:
setenforce 0
然后为下次启动编辑/etc/selinuc/config。
祝你好运!
我正在尝试使用 php56 在 Redhat 服务器上部署 Moodle LMS,我想通过 freetds 和 php-mssql 将它连接到另一个远程 MS SQL 服务器,如何一起配置它们以便能够将 Moodle LMS 连接到数据库?
假设您安装了所有需要的包(php-mssql 和 freetds)。 您必须像这样在 /etc/freetds.conf 中添加一个条目:
[mydb]
host = 10.0.0.199
port = 1433
tds version = 8.0
client charset = UTF-8
text size = 20971520
重启httpd(服务httpd重启) 然后在 moodle 中将 db name 设置为 mydb,一切都会起作用。 可能你将不得不 set/disable selinux for moodle。以这种方式临时执行此操作:
setenforce 0
然后为下次启动编辑/etc/selinuc/config。
祝你好运!