Welcome Guest, Not a member yet? Register   Sign In
CI 3 and MS SQL (sqlsrv) Error
#1
Question 

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?
Reply
#2

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

(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?
Reply
#4

(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.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB