MSSQL: connect to MSSQL server from linux using php

In ubuntu you can do the following:

1. First of all install php5-sybase, freetds-common and freetds-bin packages in debian systems

2. Edit file /etc/freetds/freetds.conf and add accordingly a section regarding your MSSQL server you are trying to cennect to.
Lets assume you created a section [proj1mssql]

3. You can connect from the php code like this:

  $dsn = 'dblib:host=proj1mssql;dbname=mydbname;charset=UTF-8';
  $dbh = new PDO($dsn, $dbuser, $dbpass);