报如下:
Uncaught Error: Call to undefined function sqlsrv_connect()
PHP 使用的是PHP工具箱
版本是 PHP 7.2.10
SQLserver 2008R2
Apache
测试代码如下:
<?php
$servern = '192.168.60.21';
$coninfo = array("Database"=>"byjzyy","UID"=>"sa","PWD"=>"W_123");
$conn=sqlsrv_connect($servern,$coninfo) or die("链接失败!!请重试!");
$val=sqlsrv_query($conn,"select top 10 * from goodsdoc");
while($row=sqlsrv_fetch_array($val)){
echo $row."<br>";
}
sqlite_close($conn);
我网友提示 :在https://www.microsoft.com/en-us/download/details.aspx?id=20098 下载了 Microsoft Drivers for PHP for SQL Server
将:
php_pdo_sqlsrv_7_ts_x86.dll 和 php_sqlsrv_7_ts_x86.dll 放到了 \php-7.2.1-nts\ext
并在php.ini
extension=php_sqlsrv_72_ts_x86.dll
extension=php_pdo_sqlsrv_72_ts_x86.dll
重启了Apache
还是会报错 求指点是什么问题