Support the ongoing development of Laravel.io →
Installation Configuration
Last updated 2 years ago.
0

I'm resurrecting this because it was one of the early results on google for my problem...

First, install php-mssql sudo apt-get update && sudo apt-get install php-mssql

Now edit freetds.conf sudo vi /etc/freetds/freetds.conf

Change the top few lines:

[global]
        # TDS protocol version
;       tds version = 8.0
;       client charste = UTF-8

Finally you should create a locales.conf file within /etc/freetds to allow correct parsing of dates with SQL Server, i have this configuration and has worked well with DateTime, DateTime2, SmallDateTime and Date data types: sudo vi /etc/freetds/locales.conf

[default]
    date format = %Y-%m-%d %I:%M:%S.%z

[en_US]
    date format = %b %e %Y %I:%M:%S:%z%p
    language = us_english
    charset = iso_1

[es_ES]
    date format = %b %d %Y %I:%M%p
    language = spanish
    charset = iso_1

[pt_BR]
    date format = %d/%m/%Y %H:%M
    language = Portuguese
    charset = iso_1

[it_IT]
    date format = %d/%m/%Y %H:%M
    language = Italiano
    charset = iso_1

Last, restart nginx sudo service nginx restart

Source: https://laracasts.com/discuss/channels/general-discussion/sqlsrv-driver-on-linux/replies/14887

0

Check this out:
carste <- mistake
[global]
# TDS protocol version
tds version = 8.0
client charset = UTF-8

Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.