| 2 | |
| 3 | Poniższy artykuł przestawia proces instalacji sterownika SQLSRV dla podłączenia źródeł danych |
| 4 | |
| 5 | https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-2017 |
| 6 | |
| 7 | === 1. Dodajemy repozytoria dla sterownika:=== |
| 8 | |
| 9 | {{{ |
| 10 | sudo su |
| 11 | curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - |
| 12 | |
| 13 | |
| 14 | #Debian 9 |
| 15 | curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list |
| 16 | |
| 17 | #Debian 10 |
| 18 | curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list |
| 19 | |
| 20 | #Debian 11 |
| 21 | curl https://packages.microsoft.com/config/debian/11/prod.list > /etc/apt/sources.list.d/mssql-release.list |
| 22 | |
| 23 | }}} |
| 24 | |
| 25 | {{{ |
| 26 | sudo apt-get update |
| 27 | sudo ACCEPT_EULA=Y apt-get install msodbcsql18 |
| 28 | sudo ACCEPT_EULA=Y apt-get install mssql-tools18 |
| 29 | echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile |
| 30 | echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc |
| 31 | source ~/.bashrc |
| 32 | }}} |
| 33 | |
| 34 | {{{ |
| 35 | sudo apt-get install unixodbc-dev |
| 36 | }}} |
| 37 | |
| 38 | |
| 39 | === 2. Komplikujemy kod dla SQLSRV=== |
| 40 | |
| 41 | {{{ |
| 42 | apt-get install php7.4-dev |
| 43 | }}} |
| 44 | |
| 45 | {{{ |
| 46 | sudo pecl install sqlsrv |
| 47 | sudo pecl install pdo_sqlsrv |
| 48 | }}} |
| 49 | |
| 50 | Wprowadzenie zmiany w config.inc. Zakomentowanie lini |
| 51 | //define('MSSQL_DB_ENCODING', 'CP1250'); |
| 52 | |
| 53 | |
| 54 | Pliki z załącznika przenosimy do: |
| 55 | |
| 56 | /etc/php/7.4/mods-avaible |
| 57 | |
| 58 | Następnie tworzymy symlinki do przeniesionych plików: |
| 59 | |
| 60 | {{{ |
| 61 | ln -s /etc/php/7.4/mods-available/sqlsrv.ini /etc/php/7.4/cli/conf.d/ |
| 62 | ln -s /etc/php/7.4/mods-available/pdo_sqlsrv.ini /etc/php/7.4/cli/conf.d/ |
| 63 | ln -s /etc/php/7.4/mods-available/sqlsrv.ini /etc/php/7.4/fpm/conf.d/ |
| 64 | ln -s /etc/php/7.42/mods-available/pdo_sqlsrv.ini /etc/php/7.4/fpm/conf.d/ |
| 65 | }}} |