Skip to main content This browser is no longer supported. Show Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support. Loading the Microsoft Drivers for PHP for SQL Server
In this articleDownload PHP driverThis page provides instructions for loading the Microsoft Drivers for PHP for SQL Server into the PHP process space. You can download the prebuilt drivers for your platform from the Microsoft Drivers for PHP for SQL Server GitHub project page. Each installation package contains SQLSRV and PDO_SQLSRV driver files in threaded and non-threaded variants. On Windows, they are also available in 32-bit and 64-bit variants. See System Requirements for the Microsoft Drivers for PHP for SQL Server for a list of the driver files that are contained in each package. The driver file must match the PHP version, architecture, and threadedness of your PHP environment. On Linux and macOS, the drivers can alternatively be installed using PECL, as found in the installation tutorial. You can also build the drivers from source either when building PHP or by using Moving the Driver File into Your Extension DirectoryThe driver file must be located in a directory where the PHP runtime can find it. It is easiest to put the driver file in your default PHP extension
directory - to find the default directory, run
Loading the Driver at PHP StartupTo load the SQLSRV driver when PHP is started, first move a driver file into your extension directory. Then, follow these steps:
Note To determine whether the driver has been successfully loaded, run a script that calls phpinfo(). For more information about php.ini directives, see Description of core php.ini directives. See AlsoGetting Started with the Microsoft Drivers for PHP for SQL Server System Requirements for the Microsoft Drivers for PHP for SQL Server Programming Guide for the Microsoft Drivers for PHP for SQL Server SQLSRV Driver API Reference PDO_SQLSRV Driver API Reference FeedbackSubmit and view feedback for How enable mssql in PHP ini?Installation overview. Install Microsoft SQL Server including SQL Server Management Studio. ... . Configure Windows for MSSQL. ... . Create and configure a new database. ... . Install PHP and a web server. ... . Install the SQL Server Driver for PHP. ... . Install and configure Moodle.. How enable Sqlsrv in PHP Linux?To install a PECL extension for multiple PHP versions, repeat the PECL extension installation for each PHP version. The SQLSRV extension provides functions for accessing Microsoft SQL Server databases.
Does PHP support mssql?Yes, Microsoft provides a MS SQL driver for PHP.
What is Pdo_sqlsrv?PDO_SQLSRV is a driver that implements the PHP Data Objects (PDO) interface to enable access from PHP to MS SQL Server (starting with SQL Server 2005) and SQL Azure databases.
|