Click Fraud Protection
PHP related blog, freelancer to hire!

Use PHP and PDO to connect to MS SQL Server (Zend Framework)

Problems connecting to MS SQL server from Zend Framework?

Message: The mssql driver is not currently installed

Solution is simple

Install pdo_mssql driver: (Ubuntu)

#sudo apt-get install php5-sybase
#sudo /etc/init.d/apache2 restart

On Centos you need to install pdo_dblib (any problems check here)

It will not reflect in phpinfo() page

Trick is to setup connection properly:

$dbAdapter = new Zend_Db_Adapter_Pdo_Mssql(array(
 'host'     => '192.xxx.xxx.xxx', // parklife
 'username' => 'xxx',
 'password' => 'xxx',
 'dbname'   => 'xxx',
'pdoType'  =>  'dblib' )
 );
Leave a Reply