Fatal Error: Undefined Function 'sqlsrv_connect()'
When trying to connect to a Microsoft Azure SQL server using XAMPP with PHP 5.6.8, an error message of "Fatal error: Call to undefined function sqlsrv_connect()" may occur. This error indicates that the PHP extension for SQL Server (SQLSRV) is not installed or not properly configured.
Solution:
To resolve this error, install the SQLSRV extension for PHP. Here are the steps:
Download the SQLSRV Extension:
Choose Your Platform:
Install the Extension:
Enable the Extension in PHP.ini:
Uncomment or Add the Extension Line:
Locate or add the following line in the php.ini file:
extension=php_sqlsrv_56_ts.dll
Save and Restart Apache:
Additional Notes:
The above is the detailed content of Why am I getting a 'Fatal error: Call to undefined function sqlsrv_connect()' when connecting to Microsoft Azure SQL Server with XAMPP and PHP 5.6.8?. For more information, please follow other related articles on the PHP Chinese website!