PHP与sql server毗连测试
【驱动文件安装】
1、下载驱动文件,在微软官网找到了:
Microsoft Drivers for PHP for SQL Server
下载 Microsoft Drivers for PHP for SQL Server - PHP drivers for SQL Server | Microsoft Learn
Microsoft Drivers for PHP 发行说明 - PHP drivers for SQL Server | Microsoft Learn
官方下载地点:
Microsoft ODBC Driver for SQL Server - ODBC Driver for SQL Server | Microsoft Learn
体系要求 - PHP drivers for SQL Server | Microsoft Learn
Microsoft Drivers for PHP 支持矩阵 - PHP drivers for SQL Server | Microsoft Learn
php利用sqlserver
1、安装ODBC程序
官方下载地点:Download ODBC Driver for SQL Server - ODBC Driver for SQL Server | Microsoft Docs
2、下载sqlsrv扩展文件
官方下载地点:Download the Microsoft Drivers for PHP for SQL Server - PHP drivers for SQL Server | Microsoft Docs
3、把扩展文件对应的版本移动到PHP对应的目录下的ext目录;
4、更改PHP的配置文件,添加扩展,(以php8.2为例)
extension=php_pdo_sqlsrv_82_ts_x64
extension=php_sqlsrv_82_ts_x64