CodeIgniter Forums
CI 3 and MS SQL (sqlsrv) Error - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: CI 3 and MS SQL (sqlsrv) Error (/showthread.php?tid=68393)



CI 3 and MS SQL (sqlsrv) Error - derena - 07-05-2017

Hi.

I am using:
- Windows Server 2008 R2 as web server
- PHP 7.1.2
- Codeigniter 3.1.4

I have a MS SQL database in my other server. (Windows Server 2012 R2)

I have problem about connecting to that MS SQL server on Windows Server 2012 R2 from my web server.

My database.php:

$db['db3']['hostname'] = '192.168.2.4';

$db['db3']['username'] = 'usrname';
$db['db3']['password'] = 'dbpassword';
$db['db3']['database'] = 'DBNAME';
$db['db3']['dbdriver'] = 'sqlsrv';
$db['db3']['dbprefix'] = '';
$db['db3']['pconnect'] = FALSE;
$db['db3']['db_debug'] = TRUE;
$db['db3']['cache_on'] = FALSE;
$db['db3']['cachedir'] = '';
$db['db3']['char_set'] = 'utf8';
$db['db3']['dbcollat'] = 'utf8_general_ci';
$db['db3']['swap_pre'] = '';
$db['db3']['autoinit'] = TRUE;
$db['db3']['stricton'] = FALSE;

And i have already installed php_sqlsrv_7_ts_x64.dll and added to my php.ini

But, i get error like this.

An uncaught Exception was encountered

Type: Error
Message: Call to undefined function sqlsrv_connect()
Filename: C:\inetpub\modul\system\database\drivers\sqlsrv\sqlsrv_driver.php
Line Number: 144
Backtrace:
File: C:\inetpub\modul\application\controllers\Welcome.php
Line: 111
Function: database

File: C:\inetpub\modul\index.php
Line: 315
Function: require_once


What should i do to solve this problem?


RE: CI 3 and MS SQL (sqlsrv) Error - Narf - 07-05-2017

Install the sqlsrv extension ... This is really the easiest thing to figure out.


RE: CI 3 and MS SQL (sqlsrv) Error - derena - 07-07-2017

(07-05-2017, 04:22 AM)Narf Wrote: Install the sqlsrv extension ... This is really the easiest thing to figure out.

Do you mean Microsoft's Drivers (DLLs) package for PHP or anything else?


RE: CI 3 and MS SQL (sqlsrv) Error - defirso - 10-29-2017

(07-07-2017, 05:29 AM)derena Wrote:
(07-05-2017, 04:22 AM)Narf Wrote: Install the sqlsrv extension ... This is really the easiest thing to figure out.

Do you mean Microsoft's Drivers (DLLs) package for PHP or anything else?

Hi, have you solved your issue? I got the same problem.