简体   繁体   中英

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

I want to enable MSSQL support on my Linux server via PHP. I can't seem to figure out the proper way to go about this. Some threads suggested I install 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?

What do I need to do to run MSSQL queries on a Linux box via PHP?

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:

  1. 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
  3. 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/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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