See the notes at the beginning of each section to install PHP 7.4 or 7.3 instead.Īlso included are instructions for installing the PHP FastCGI Process Manager, PHP-FPM, on Ubuntu. Some supported Linux distros default to PHP 7.1 or earlier, which is not supported for the latest version of the PHP drivers for SQL Server. You may need to run pecl channel-update first. The following instructions install PHP 8.0 by default using pecl install, if the PHP 8.0 packages are available. For an explanation of extension loading and why we do not add the extensions to php.ini, see the section on loading the drivers.
These instructions advise installing the drivers using PECL, but you can also download the prebuilt binaries from the Microsoft Drivers for PHP for SQL Server GitHub project page and install them following the instructions in Loading the Microsoft Drivers for PHP for SQL Server.
The following instructions assume a clean environment and show how to install PHP 8.0, the Microsoft ODBC driver, the Apache web server, and the Microsoft Drivers for PHP for SQL Server on Ubuntu, Red Hat, Debian, Suse, Alpine, and macOS.