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:
$dbh = new PDO($dsn, $dbuser, $dbpass);