![]() |
[split] PHP7 - MS SQL server - 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: [split] PHP7 - MS SQL server (/showthread.php?tid=65691) |
[split] PHP7 - MS SQL server - mahomedsh - 07-12-2016 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/hh568454(v=sql.110).aspx) ) As I had already typed it up, and it has error messages that other might search for, I'm posting anyway. ![]() =================================================== I'm new to CI and fairly beginner on PHP (so please go easy on me ![]() 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 And Code: A PHP Error was encountered 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/hh568454(v=sql.110).aspx) and then replacing all the mssql_* functions for their odbc equivalent and that works fine. |