CodeIgniter Forums
CI and SQL Server from Linux - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: CI and SQL Server from Linux (/thread-61224.html)



CI and SQL Server from Linux - El Forum - 10-20-2014

[eluser]dimas[/eluser]
Hi,

I'm actually developing a CI app in my developer machine with Windows and XAMPP, using de sqlsrv driver to connect to the MS SQL Server 2008 database.

But the final server machine is an Ubuntu server, and trying to run the app from there doesn't work because of the sqlsrv driver not installed in the server.

I tried the mssql driver and the app starts to load but it ends with SQL queries errors (SQL queries previously tested and working).

What do you recommend me?
Is it possible to connect from Linux/PHP/CI to SQL Server 2008? If there is a way, will it be as fast as running on Windows?
Is it better to create a new Windows server?

Thx



CI and SQL Server from Linux - El Forum - 10-20-2014

[eluser]rufnex[/eluser]
You have to install a SQL Server Driver on Linux:

http://www.freetds.org/

or

http://msdn.microsoft.com/en-us/library/hh568451(v=sql.110).aspx

I use for a project the freetds witch works easy and fast.


CI and SQL Server from Linux - El Forum - 10-20-2014

[eluser]dimas[/eluser]
[quote author="rufnex" date="1413823198"]You have to install a SQL Server Driver on Linux:

http://www.freetds.org/

or

http://msdn.microsoft.com/en-us/library/hh568451(v=sql.110).aspx

I use for a project the freetds witch works easy and fast.[/quote]

freetds is not compatible with UTF-8 :-(


CI and SQL Server from Linux - El Forum - 10-21-2014

[eluser]rufnex[/eluser]
UTF-8 is a problem from the sql server .. so you need freetds > 7.0 look here for details:

http://stackoverflow.com/questions/13377812/getting-data-with-utf-8-charset-from-mssql-server-using-php-freetds-extension


CI and SQL Server from Linux - El Forum - 10-21-2014

[eluser]dimas[/eluser]
[quote author="rufnex" date="1413906607"]UTF-8 is a problem from the sql server .. so you need freetds > 7.0 look here for details:

http://stackoverflow.com/questions/13377812/getting-data-with-utf-8-charset-from-mssql-server-using-php-freetds-extension[/quote]

A problem from the SQL Server? In SQL Server I can specify the encoding of the fields to UTF8, and with the sqlsrv PHP library for Windows I can get data from the server in UTF8. I think this is more a problem of the Linux libraries :-(

Transforming it manually isn't a good option.. but maybe is the unique, thx Sad


CI and SQL Server from Linux - El Forum - 10-21-2014

[eluser]rufnex[/eluser]
Ok, but have you tried the tip from stackoverflow?