Welcome Guest, Not a member yet? Register   Sign In
[split] PHP7 - MS SQL server
#1

(This post was last modified: 07-12-2016, 09:17 AM by ciadmin.)

Hi

Well after typing all the info below, I found the solution to my issue by changing my "driver" from "mssql" to "odbc" in my database.php and I can now connect to my MS SQL server. (Though I think you first have to install the "Microsoft ODBC Driver for SQL Server on Linux" (https://msdn.microsoft.com/en-us/library....110).aspx) )

As I had already typed it up, and it has error messages that other might search for, I'm posting anyway. Smile

===================================================
I'm new to CI and fairly beginner on PHP (so please go easy on me Smile )

I had CI 3.0.6 running fine with PHP 5.6 and I was able to successfully connect to both MySQL and MS SQL databases. Yesterday I had to upgrade to Ubuntu 16.04 with PHP 7.0.4. The welcome page works fine but unfortunately the database access to MSSQL is now failing.

The two error messages I get are:

Code:
An uncaught Exception was encountered

Type: Error

Message: Call to undefined function mssql_connect()

Filename: /var/www/cib/system/database/drivers/mssql/mssql_driver.php

Line Number: 113

And

Code:
A PHP Error was encountered

Severity: Core Warning

Message: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_pdo_odbc.dll' - /usr/lib/php/20151012/php_pdo_odbc.dll: cannot open shared object file: No such file or directory

Filename: Unknown

Line Number: 0

I have confirmed that the file /usr/lib/php/20151012/php_pdo_odbc.dll no longer exists.

I also checked /var/www/cib/system/database/drivers/mssql/mssql_driver.php which is using the mssql_connect() funtions and basically all the mssql_* functions are removed from PHP 7.

I have managed to get my other code (vanilla PHP) working by installing the "Microsoft ODBC Driver for SQL Server on Linux" (https://msdn.microsoft.com/en-us/library....110).aspx) and then replacing all the mssql_* functions for their odbc equivalent and that works fine.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB