I spend a lot of hours in order to find a way to connect with php to a remote microsoft sql server.
Finally i manage to do that
First instal EPEL repository
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo rpm -Uvh epel-release-6*.rpm
then install mssql.so
yum install php-mssql
restart apache
/etc/init.d/httpd restart
put this in a file for example phpinfo.php and check if the module is on. Check on additional .ini files parsed for mssql.ini
<?php
phpinfo();
?>
then put this code in the file that you want to connect
//—-database connect
$server = «mssqlserver_domain_or_ip»;
$user = «mssqluser»;
$pass = «password»;
$database = «databasefrommssql»;
ini_set(‘mssql.charset’, ‘UTF-8’);
$dbhandle = mssql_connect($server, $user, $pass)
or die(«Couldn’t connect to SQL Server on $server»);
$selected = mssql_select_db($database, $dbhandle)
or die(«Couldn’t open database $database»);