且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

PHP PDO mssql错误

更新时间:2022-06-15 23:13:50

最后,我发现了问题,这是由于计算机和Windows服务器上的Windows最近更新所致.此更新后,mssql pdo驱动程序将引发此错误.我已经从Microsoft网站下载了sqlsrv20驱动程序并放置了文件
php扩展目录中的php_pdo_sqlsrv_53_ts_vc6.dll并在php.ini文件中添加了新扩展名,例如extension = php_pdo_sqlsrv_53_ts_vc6.dll并更改了pdo连接性

Finally, I have found the issue, This is because of recent windows update on my machine and our windows server. After this update mssql pdo driver throws this error. I have downloaded sqlsrv20 driver from microsoft website and placed the file
php_pdo_sqlsrv_53_ts_vc6.dll inside php extension directory and added new extension in php.ini file like extension=php_pdo_sqlsrv_53_ts_vc6.dll and changed the pdo connectivity

$dbcon = new PDO( "sqlsrv:server=$conf->host;Database=$conf->db_name", $conf->db_user, $conf->db_pwd); 

注意:对于Wamp服务器,用户还需要检查apache中的php.ini,并且需要在apache下的php.ini文件中添加扩展名.

Note : for wamp server users needs to check php.ini in apache also and needs to add the extension in php.ini file under apache.