i have problem connecting to azure on my mac. I've read many articles here and added multiple extension to my php.ini file but nothing seems to work. I just want to simply run this code and connect to database. All the variables in the code have the actual values are correct.
At the moment it gives me following error : "PDOException Object ( [message:protected] => could not find driver".
i've looked throuh mutiple articles on this issue, and added extensions to php.ini. i've pasted all of the below for people to check. i also now that i have PDO attached to my server. Unforunately, i cant post the screemshot here, but my pdo_mysql, pdo_pgsql, pdo_sqlite in the phpinfo() call.
i would really appreciate any info and help on this matter. thank you!
$server = "tcp:*********.database.windows.net,1433";
$user = "jus***@********";
$pwd = "password";
$db = "testdb";
try
{
$conn = new PDO( "sqlsrv:Server= $server ; Database = $db ", $user, $pwd);
$conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
}
catch(Exception $e)
{
die(print_r($e));
}
;Extensions
;extension=apcu.so
extension=imap.so
extension=yaz.so
extension=mcrypt.so
extension=gettext.so
extension=pgsql.so
extension=pdo_pgsql.so
extension=pdo_mysql.so
extension=php_pdo.dll
extension=php_pdo_mysql.dll
extension=php_pdo.dll
extension=php_pdo_firebird.dll
extension=php_pdo_informix.dll
extension=php_pdo_mssql.dll
extension=php_pdo_mysql.dll
extension=php_pdo_oci.dll
extension=php_pdo_oci8.dll
extension=php_pdo_odbc.dll
extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=imagick.so