简体   繁体   English

如何在Linux服务器上为PHP启用MSSQL支持?

[英]How can I enable MSSQL support for PHP on a Linux server?

I want to enable MSSQL support on my Linux server via PHP. 我想通过PHP在Linux服务器上启用MSSQL支持。 I can't seem to figure out the proper way to go about this. 我似乎无法找出解决此问题的正确方法。 Some threads suggested I install php5-sybase. 一些线程建议我安装php5-sybase。 I did this, but I'm not sure that this has all of MSSQL's functionality in it, not to mention that sybase is a different RDMBS all together, right? 我是这样做的,但是我不确定它是否具有MSSQL的所有功能,更不用说sybase完全是一个不同的RDMBS,对吗?

What do I need to do to run MSSQL queries on a Linux box via PHP? 我要怎么做才能通过PHP在Linux机器上运行MSSQL查询?

You have to install freeTds as drivers for mssql server and after that you have to install php-mssql extension for php support following are some tutorials you can use: 您必须安装freeTds作为mssql服务器的驱动程序,然后再安装php-mssql扩展以获得php支持,下面是一些可以使用的教程:

  1. http://guywyant.info/log/206/connecting-to-ms-sql-server-from-ubuntu/ http://guywyant.info/log/206/connecting-to-ms-sql-server-from-ubuntu/
  2. https://secure.kitserve.org.uk/content/accessing-microsoft-sql-server-php-ubuntu-using-pdo-odbc-and-freetds https://secure.kitserve.org.uk/content/accessing-microsoft-sql-server-php-ubuntu-using-pdo-odbc-and-freetds
  3. http://network-wizard.blogspot.ca/2009/03/install-freetds-on-ubuntu.html http://network-wizard.blogspot.ca/2009/03/install-freetds-on-ubuntu.html

You can use PDO following is the tutorial for that http://ollieparsley.com/2014/05/29/linux-php-pdo-sql-server/ 您可以使用PDO,以下是该http://ollieparsley.com/2014/05/29/linux-php-pdo-sql-server/的教程

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM