Connect to MSSQL database with PHP 5.6.4

I have a server that is running Windows Server 2008 R2, 64-bit.  It has PHP 5.6.4 installed on it running via IIS7.  I'm trying to connect to a SQL database that resides on a different server.  There is no official SQL extension for PHP 5.6.4 so I have downloaded one that I found here that others seem to have success with.  I still can't get my script to connect.  

I've tried connecting to the SQL server from yet another server running an older version of PHP for which there is an official PHP SQL extension and it connects without a problem.  I'm even able to successfully telnet to the SQL server on port 1433 and it answers.  Therefore, I know there's not a problem connecting to the remote SQL server due to a networking issue.

To test whether or not I'm able to connect, I have the following in my script:
$serverName = "<<SERVER IP ADDRESS>>";
$uid = "login";
$pwd = "password";
$connectionInfo = array( "UID"=>$uid,"PWD"=>$pwd,"Database"=>"Database_name");
$conn = sqlsrv_connect( $serverName, $connectionInfo);

if($conn)
{
    echo "works";
}
else 
{
    echo "fails";
}

Open in new window


I have E_ALL & ~E_DEPRECATED set for error_reporting and display_errors is set to On.  I get no errors whatsoever.  All i get is "fails".

What is it that could be holding me up?

The attached image shows the pertinent sections from running phpinfo on the server that is running 5.6.4.  I've compared these sections to the server running the older version of PHP and they are the same.
PHP-5.6.4-SQL.jpg
brstoresAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gr8gonzoConsultantCommented:
I would just use version 3.1 of this driver:
https://www.microsoft.com/en-us/download/details.aspx?id=20098

Worst case, use ODBC.
0
brstoresAuthor Commented:
I've tried that driver, it didn't work either.  There was an error in the message log stating that the version of the SQL extension didn't match the version of PHP.

I've never had any luck with ODBC.  I guess I've only really ever tried it once, but for some reason or another, I couldn't get it working.
0
gr8gonzoConsultantCommented:
Sorry, then. I run a SQL Server / PHP app, but there's been no reason for me to update past 5.3 yet, so I'm still using the official driver.

However, ODBC should definitely work. In fact, that's probably the most reliable long-term solution, since it's a generic driver that is not specific to any PHP version. I would give that another try.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.