• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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, 05: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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.