我的Windows机器上有CakePHP 2.x和PHP 5.4.3(Windows 8,使用WAMP)。我必须在其他mssql服务器上连接,因为我需要一些数据。我已经尝试了很多方法来连接但是 错误消息始终相同:
Error: A Database connection using "Sqlserver" was missing or unable to connect.
The database server returned this error: Selected driver is not enabled
Error: Sqlserver driver is NOT enabled
我的database.php配置:
public $urniki = array(
'datasource' => 'Database/Sqlserver',
'persistent' => false,
'host' => 'somehost.com',
'login' => 'user',
'password' => 'pass',
'database' => 'db',
'prefix' => '',
'encoding' => 'utf8',
);
知道如何连接它?
答案 0 :(得分:3)
确保已安装PHP的SQL Server驱动程序,此行在您的php.ini
中Extension=php_sqlsrv.dll