Ajmal Moideen
Ajmal Moideen

Reputation: 230

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?

Upvotes: 0

Views: 3804

Answers (1)

Ajmal Moideen
Ajmal Moideen

Reputation: 230

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;

Upvotes: 0

Related Questions