简体   繁体   中英

PHP 5.6 : Fatal error: Call to undefined function sqlsrv_connect()

I am quite new to setting php with ms sql server.

I downloaded the php version php-5.6.31-nts-Win32-VC11-x86 and downloaded the drivers for ms sql db to the ext folder in the php path.

I can see the files php_sqlsrv_56_nts.dll and php_sqlsrv_56_ts.dll

I have also modified the php.ini file to extention=php_sqlsrv_56_nts.dll and extension_dir ="ext"

I have some php files in path1

I opened the command prompt in the php folder and executed the following command: php -S localhost:8085 -t path1

The server is setup succesfully. However, I get an error Fatal error:

Call to undefined function sqlsrv_connect() in the line

$conn = sqlsrv_connect($servername, $connectionInfo);

Did I miss anything here?

I understood my error. I added both the dll files in php.ini and this worked extention=php_pdo_sqlsrv_56_nts.dll extension=php_sqlsrv_56_nts.dll;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM