We have recently been working on a project for a client that involves dynamically creating web pages from data stored in a Microsoft SQL database. The solution is based on a LAMP (Linux, Apache, MySQL and PHP) server running Ubuntu.
Why not use IIS I hear you ask? Mainly because of costs and licensing and the Ubuntu server will be running several Web sites.
Here is a very basic example of the PHP code using PDO and DBLIB:
$dbh= new PDO('dblib:host=SERVERNAME\SQLSERVERINSTANCE;dbname=DBNAME',$user,$password);
$query = “SELECT * FROM SOME_TABLE”;
$statement = $dbh->prepare($query);
$result = $statement->fetchAll(PDO::FETCH_ASSOC);
You need to install the DBLIB PDO driver:
sudo apt-get install php7.0-sybase