Jump to content

PHP Not connecting to SQL Server


PHPOMY

Recommended Posts

Windows 2012 R2 Web Farm

IIs 8.5

PHP 7.2

 

 

I am trying to create a logon page using PHP  create a database on my SQL 2014 server.

Installed the PHP SQL Server Drivers for PHP 7.2

<?php
// Server in the this format: <computer>\<instance name> or
// <server>,<port> when using a non default port number
$server = 'SQLC,1433';

// Connect to MSSQL
$link = mssql_connect($server, 'phpuser', 'xxxxxxxxxxxxxx');

if (!$link) {
    die('Something went wrong while connecting to MSSQL');
}
?>

I get an HTTP 500 internal server error cant get past this one

Any thing else I can provide to help us fix this let me know

 

Thank you

 

Tom

Link to comment
Share on other sites

Benanamen

Thank you for the fast response

 

I saw that link yesterday and tried that code

 

<?php
// Server in the this format: <computer>\<instance name> or
// <server>,<port> when using a non default port number
$server = 'SQLC,1433';

// Connect to MSSQL
$link = mssql_connect($server, 'phpuser', 'xxxxxxxxxxx');

if (!$link) {
    die('Something went wrong while connecting to MSSQL');
}
?>

Named it testconnection.php

HTTP 500 Internal Server Error.

 

Any ideas?

Thakn you

 

Tom

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.