views:

70

answers:

2

Hi,

This is my first time using ms sql with cakephp. Usually I use mysql. I've edited my database.php file:

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' => '',
);
}

However when I view the index page i get this error:

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

It's coming from this constructor in the dbo_mssql.php file:

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);
}

I have the mssql extension in the php ini file

extension=php_mssql.dll

I've been using mssql databases with PHP on my setup extensively but am wondering if its because the ini file in my php directory are php.ini file is called php.ini-development and php.ini-production but I actually use a php.ini file sitting on the root of C:

Has anyone had to deal with this before? Or anyone know what I need to do? Using W7 btw.

Jonesy

A: 

You can`t use extension=php_mssql.dll in php 5.3* versions.
You need to use MSSQL driver for php
MSSQL driver


Open php.ini ,just add this line
extension=php_sqlsrv_53_ts_vc9.dll

Dezigo
Sorry I have that extension as well but still same error
iamjonesy
A: 

What's the version of CakePHP you're using ?

Another thing, please check about the extension at http://localhost/phpinfo.php.

You should find the extensions that are enabled and seen by the server.

Memo Mazaz