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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.