PHP MS SQL Unix驱动程序-Microsoft或FreeTDS [英] PHP MS SQL Unix Driver - Microsoft or FreeTDS
问题描述
我正在运行LAMP服务器,但现在需要连接到MS SQL(客户端请求).我听说Microsoft有驱动程序,但无法验证
I am running a LAMP server but now need to connect to MS SQL (client request). I have heard Microsoft has a driver, but can't verify if
有人知道Microsoft驱动程序是否可用于Unix吗?如果没有,我应该坚持使用FreeTDS吗? PHP 似乎建议这样做,但是似乎缺少安装文档.任何一个方向都将不胜感激.
Does anyone know if the Microsoft driver is available for Unix? If not, should I just stick with FreeTDS? This appears to be recommended by PHP, however install documentation seems lacking. Any direction on either would be greatly appreciated.
很抱歉,我对设置PHP驱动程序不熟悉.
Sorry for the general question, I am not familiar with setting up PHP drivers.
就某些背景而言,我正在从LAMP服务器运行Intranet,但需要连接到外部MS SQL DB Server(当然是Windows)上的数据源.我正在运行PHP5.
Just for some back story, I am running an intranet from the LAMP server but needs to connect to a datasource on an external MS SQL DB Server (Windows of course). I am running PHP5.
推荐答案
FreeTDS很好,并且效果很好. Microsoft驱动程序仅是Windows,因此您将无法在Linux服务器上使用它.
FreeTDS is fine and works well enough. The Microsoft driver is Windows only, thus you wouldn't be able to use it on your Linux server.
首先安装FreeTDS,然后使用--with-mssql=/prefix/used/for/freetds
配置PHP.如果您使用的是发行版的PHP,我确定已经预编译了一个MS-SQL驱动程序包并可以安装(在Ubuntu中,它将是php5-sybase).
First install FreeTDS and then configure PHP with --with-mssql=/prefix/used/for/freetds
. If you are using your distribution's PHP, I'm sure there is a MS-SQL driver package already precompiled and available for installation (in Ubuntu, that'd be php5-sybase).
然后使用PHP的mssql_ *函数实际完成工作
Then use PHP's mssql_* functions to actually do the work
这篇关于PHP MS SQL Unix驱动程序-Microsoft或FreeTDS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!