Engin
Engin

Reputation: 59

Fatal error: Call to undefined function sqlsrv_connect() in php 5.6.25

OS: Windows 8.1

Web Server: WAMPSERVER 3.0.6

PHP Version: 5.6.25

Goal: To establish MYSQL Database connection using PHP

What has been done:

But: phpinfo() is not listed in sqlsrv()

Code:

$myServer = "(local)";
$myUser = "sa";
$myPass = "pass";
$myDB = "example_db";
$connectionInfo = array("Database"=>$myDB, "UID" => $myUser, "PWD" => $myPass);
$conn = sqlsrv_connect($myServer, $connectionInfo);

Error:

Fatal error: Call to undefined function sqlsrv_connect() in
C:\wamp64\www\optimum_p\common\dbconnect.php on line 6 

Upvotes: 0

Views: 424

Answers (1)

I A Khan
I A Khan

Reputation: 8839

As per OP's comment:

The problem was WAMP, to fix the problem:

  1. uninstall WAMP
  2. install XAMPP

Problem solved.

Upvotes: 1

Related Questions