0

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:

  • Downloaded SQLSRV Drivers (SQLSRV32.EXE)
  • Copied files php_pdo_sqlsrv_56_ts.dll and php_sqlsrv_56_ts.dll to the directory "C:\wamp64\bin\php\php5.6.25\ext"
  • extension_dir = "c:/wamp64/bin/php/php5.6.25/ext/"
  • Added the following lines to the dynamic extensions part in the php.ini file:

    • extension=php_pdo_sqlsrv_56_ts.dll
    • extension=php_sqlsrv_56_ts.dll
  • Restarted Web Server

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 
Taku
  • 31,927
  • 11
  • 74
  • 85
Engin
  • 59
  • 4

1 Answers1

1

As per OP's comment:

The problem was WAMP, to fix the problem:

  1. uninstall WAMP
  2. install XAMPP

Problem solved.

Taku
  • 31,927
  • 11
  • 74
  • 85
Imran Ali Khan
  • 8,469
  • 16
  • 52
  • 77