Background
I have an ubuntu server running laravel that needs to connect to a different server of ours running mssql.
Linux server:
- Ubuntu 20.04
- php 8.1
I created a laravel test query to help me debug the process. As expected it gave a could not find driver
exception as expected.
Next I attempted to follow the Microsoft instructions. These are at:
Steps taken so far
sudo pecl install sqlsrv
sudo pecl install pdo_sqlsrv
I quickly sanity checked the next command: (printf "; priority=20\nextension=sqlsrv.so\n" > /etc/php/8.1/mods-available/sqlsrv.ini
). However, this gave a problem. The sqlsrv.ini
file did not exist.
To be clear: /etc/php/8.1/mods-available/sqlsrv.ini
does not exist.
(.. and thus sudo phpenmod -v 8.1 sqlsrv pdo_sqlsrv
obviously wont work)
I ran sudo pecl install pdo_sqlsrv
to double check I hadn't missed anything, and it gave the error:
pecl/pdo_sqlsrv is already installed and is the same as the released version 5.10.1 install failed
Question
How do I either:
- complete my php
pdo_sqlsrv
driver installation; OR - do it correctly from scratch
Many thanks