1 year ago

#246806

test-img

Jackawan

sqlsrv_connect not connecting on WAMP but will connect on IIS

I have a website in development on IIS but i'm moving to a new laptop and decided to use WAMP instead.

I have installed the correct version of the driver of sqlsrv for PHP as it shows up in phpinfo as enabled.

However it won't connect to the database, it's an exact copy of my working directory but in WAMP rather than IIS.

This is the code below just from a connection test file and it fails every time.

CODE

<?php
$serverName = "OMITTED";
$connectionInfo = array ("Database"=>"OMITTED", "UID"=>"sa", "PWD"=>'OMITTED');
$conn = sqlsrv_connect($serverName, $connectionInfo);
if ($conn === FALSE){
    die("Failed to connect to database!");
}
?>

Any help is appreciated. TIA.

php

sql-server

wamp

sqlsrv

0 Answers

Your Answer

Accepted video resources