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
SQLSRVDrivers (SQLSRV32.EXE) - Copied files
php_pdo_sqlsrv_56_ts.dllandphp_sqlsrv_56_ts.dllto 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.inifile:extension=php_pdo_sqlsrv_56_ts.dllextension=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