Calltoundefinedfunctionsqlsrv_connect () php sqlserver
Version: php-5.3.20 + SQLServer2005 + Apache2.2.22 + ZendStudio-7.2.1
(Windows 7 32-bit)
Extended DLL: php_sqlsrv_53_ts_vc9.dll
Php_pdo_sqlsrv_53_ts_vc9.dll
Already placed in php/ext
The test procedure is as follows:
$ ServerName = "localhost ";
$ ConnectionInfo = array ("Database" => "imp_db", "UID" => 'sa ', "PWD" => 'sa ');
Global $ serverName;
Global $ connectionInfo;
$ Conn = sqlsrv_connect ($ serverName, $ connectionInfo );
If ($ conn = false)
{
Die (print_r (sqlsrv_errors (), true ));
Return NULL;
}
Echo "OK! ";
?>
However, Zend studio reports the Debug Error:/imp/newfile. php line 14-Call to undefined function sqlsrv_connect ()
I found a lot of information and still did not solve it .....
I'm a newbie. I just started learning PHP. please kindly advise !!!
Reply to discussion (solution)
Cause analysis:
1. add extension = php_sqlsrv_53_ts_vc9.dll to the php. ini file
2. whether the php_sqlsrv_53_ts_vc9.dll version matches the current php version.
3. check whether the apache server is restarted.
The preceding three problems have been verified. in phpinfo (), if Thread Safety is set to enable, it is ts ..
I have tested php5.2 only, 5.3, and 54, but not supported, even though the package provided by Microsoft says yes.