Connect Sql Server 5.6 from Php in Linux CentOS 6

Posted by admin on March 28, 2016
sql server

To connect to SQL Server from Linux use this command to install the driver:
[bash]
$ sudo yum install -y php-mssql
[/bash]

For example, to php5.6:
[bash]
$ sudo yum install -y php56w-mssql
[/bash]

This command installs freetds , a collection of libraries to connect to SQL Server from Linux. With this library we can not only connect from Php, but from the command line with the tsql program.

After installing, do not forget to restart apache:
[bash]
$ sudo apachectl restart
[/bash]

Happy coding 🙂

Tags: , , , , , , ,

35 Comments to Connect Sql Server 5.6 from Php in Linux CentOS 6

Leave a Reply

Your email address will not be published. Required fields are marked *