Welcome Guest, Not a member yet? Register   Sign In
Connecting to MsSQL database
#1
Brick 

Ubuntu: 16.04 
Apache:  Apache/2.4.18 (Ubuntu)
CI: 3.1.6

I've been spinning my wheels on this for a day or two, think i need some help!  I am making a clean build, for a very old CI based application with all the new bells and whistles - But i cannot get a basic database connection to work on the new box.

application\models\User_model.php::
Code:
class User_Model extends CI_Model
{    
    function __construct()
    {
        parent::__construct();    
               $this->load->database();    
    }
}


application\config\database.php::
Code:
$db[$active_group] = array(
    'dsn'    => '',
    'hostname' => 'THE_HOSTNAME',
    'username' =>    "THEUSERNAME",
    'password' =>    "THEPASSWORD",
    'database' =>    "THEDATABASE",
    'dbdriver' =>    "mssql",
    'dbprefix' => '',
    'pconnect' => TRUE,
    'db_debug' => (ENVIRONMENT !== 'production'),
    'cache_on' => FALSE,
    'cachedir' => '',
    'char_set' => 'utf8',
    'dbcollat' => 'utf8_general_ci',
    'swap_pre' => '',
    'encrypt' => FALSE,
    'compress' => FALSE,
    'stricton' => FALSE,
    'failover' => array(),
    'save_queries' => TRUE
);


And when it is run:

Quote:An uncaught Exception was encountered
Type: Error

Message: Call to undefined function mssql_pconnect()

Filename: /var/www/moar.innisfil.ca/system/database/drivers/mssql/mssql_driver.php

Line Number: 112


Line 112 is as follows (Unmodified from the downloaded version of CI) ::
PHP Code:
        $this->conn_id = ($persistent)
                ? 
mssql_pconnect($this->hostname$this->username$this->password)
                : 
mssql_connect($this->hostname$this->username$this->password); 



Obviously there may be a package or two missing, from ubuntu, or apache, but I can not figure out which.  Help would be very much appreciated!!  Attached is output from phpinfo

Attached Files
.html   phpinfo.html (Size: 82.44 KB / Downloads: 174)
Reply


Messages In This Thread
Connecting to MsSQL database - by Juicepig - 01-11-2018, 09:27 AM
RE: Connecting to MsSQL database - by jreklund - 01-11-2018, 02:15 PM
RE: Connecting to MsSQL database - by Juicepig - 01-15-2018, 01:02 PM
RE: Connecting to MsSQL database - by InsiteFX - 01-12-2018, 04:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB