Calltoundefinedfunctionsqlsrv_connect ()

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.