这是我第一次在cakephp中使用ms sql。通常我使用mysql。我已经编辑我的database.php中的文件:CakePHP:尝试使用mssql数据源时出错
class DATABASE_CONFIG {
var $default = array(
'driver' => 'mssql',
'persistent' => false,
'host' => 'jura',
'login' => 'sa',
'password' => '********',
'database' => 'clientportal',
'prefix' => '',
);
var $test = array(
'driver' => 'mssql',
'persistent' => false,
'host' => 'jura',
'login' => 'sa',
'password' => '********',
'database' => 'clientportal',
'prefix' => '',
);
}
然而,当我查看索引页面我得到这个错误:
PHP SQL Server interface is not installed, cannot continue. For troubleshooting information, see http://php.net/mssql/
Fatal error: Call to undefined function mssql_min_message_severity() in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\clientportaladmin\cake\libs\model\datasources\dbo\dbo_mssql.php on line 123
它从这个构造函数来在dbo_mssql.php文件:
function __construct($config, $autoConnect = true) {
if ($autoConnect) {
if (!function_exists('mssql_min_message_severity')) {
trigger_error(__("PHP SQL Server interface is not installed, cannot continue. For troubleshooting information, see http://php.net/mssql/", true), E_USER_WARNING);
}
mssql_min_message_severity(15);
mssql_min_error_severity(2);
}
return parent::__construct($config, $autoConnect);
}
我在PHP ini文件的扩展名MSSQL
extension=php_mssql.dll
我一直在我的设置广泛使用PHP的mssql数据库,但我想知道是否因为我的php目录中的ini文件是php.ini文件被称为php.ini-开发和php.ini生产,但我实际上使用一个坐在C的根上的php.ini文件:
有没有人需要处理这个问题?或者任何人知道我需要做什么?使用W7 btw。
Jonesy
你有什么版本的PHP? – Dezigo 2010-10-13 08:27:33
我正在使用php版本5.3.3 – iamjonesy 2010-10-13 08:38:22
您正在使用哪个版本的CakePHP? – icc97 2013-08-08 12:20:01