I currently have a web server set up on DigitalOcean that i work from, i've been creating various web apps and now i need to use php to connect to a database hosted by Microsoft Azure, it uses PDO
try {
$conn = new PDO("sqlsrv:server = tcp:NAME.database.windows.net,1433; Database = DATABASE", "USERNAME", "PASS");
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
catch (PDOException $e) {
print("Error connecting to SQL Server.");
echo 'ERROR: ' . $e->getMessage();
die(print_r($e));
}
And this is the result:
Error connecting to SQL Server.ERROR: could not find driverPDOException Object ( [message:protected] => could not find driver [string:Exception:private] => [code:protected] => 0 [file:protected] => /var/www/html/angularv3/leon3.php [line:protected] => 3 [trace:Exception:private] => ...
Now i've opened up the console and typed the following to make sure it's all installed
sudo apt-get install php5-mysql
and still nothing, there must be something major i'm missing. Is it possible to connect to an azure database from anywhere?