search

Home  >  Q&A  >  body text

PHP 7.2.10 link SQLserver2008r2 error report

The report is as follows:

Uncaught Error: Call to undefined function sqlsrv_connect()


##PHP uses the PHP toolbox

The version is PHP 7.2.10

SQLserver 2008R2

Apache


The test code is as follows:

< ;?php

$servern = '192.168.60.21';
$coninfo = array("Database"=>"byjzyy","UID"=>"sa","PWD"=>" W_123");
$conn=sqlsrv_connect($servern,$coninfo) or die("Link failed!! Please try again!");
$val=sqlsrv_query($conn,"select top 10 * from goodsdoc");
while($row=sqlsrv_fetch_array($val)){
echo $row."<br>";
}
sqlite_close($conn);




My netizen tips: https://www.microsoft.com/en-us/download/ details.aspx?id=20098

Downloaded Microsoft Drivers for PHP for SQL Server Put:

php_pdo_sqlsrv_7_ts_x86.dll and php_sqlsrv_7_ts_x86.dll into \php-7.2.1-nts \ext

And in php.ini

extension=php_sqlsrv_72_ts_x86.dll

extension=php_pdo_sqlsrv_72_ts_x86.dll

Restarted Apache

I still get an error. Please give me some advice.

_|*.吥謵鏆_|*.吥謵鏆2064 days ago1372

reply all(0)I'll reply

No reply
  • Cancelreply