I have followed the instructions on the tutorial for installation on Linux, but unfortunately the Unix ODBC dependencies are not available in the repos for Ubuntu 19.04.
I've managed even to compile the drivers with PECL and loading into my PHP cli and Apache (but the question is not about Apache or LAMP stack, is about the PHP drivers), but keeps telling me about the ODBC driver.
I'm not trying to install SQL Server itself, just the native and PDO drivers for PHP being able to connect to the database, which is managed by Azure. I'm not intereseted in a LAMP stack 'cause I don't need MySQL nor Apache, at this moment I'm trying to do Functional Automated Testing, and the deploy to production goes to an IIS Server.
31 Answer
There is another article within the Microsoft's documentation, called Installing the Microsoft ODBC Driver for SQL Server on Linux and macOS. I think the steps mentioned there are exactly what you are searching for.
For Ubuntu 19.04 they offer only Microsoft ODBC Driver 17 for SQL Server, here is the relevant part:
This article explains how to install the Microsoft ODBC Driver for SQL Server on Linux and macOS, as well as the optional Command-Line Tools for SQL Server (bcp and sqlcmd) and the unixODBC Development Headers.
Important: If you installed the v17
msodbcsqlpackage that was briefly available, you should remove it before installing themsodbcsql17package. This will avoid conflicts. Themsodbcsql17package can be installed side by side with themsodbcsqlv13 package.Ubuntu
sudo su curl | apt-key add - #Ubuntu 19.04 curl > /etc/apt/sources.list.d/mssql-release.list exit sudo apt-get update sudo ACCEPT_EULA=Y apt-get install msodbcsql17 # optional: for bcp and sqlcmd sudo ACCEPT_EULA=Y apt-get install mssql-tools echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc source ~/.bashrc # optional: for unixODBC development headers sudo apt-get install unixodbc-devNote
- Driver version 17.2 or higher is required for Ubuntu 18.04 support.
- Driver version 17.3 or higher is required for Ubuntu 18.10 support.