cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Go to solution
Highlighted

PHP 7.3 Connection using sqlsrv_connect

Hello,

I am updating PHP from 5.6.40 to 7.3.8 and am having issues utilizing my sqlsrv_connect functions in PHP. Is there a new Microsoft Driver that I need to configure my PHP to use to get this working again?

 

Example Code:

I have an array $config that I'm storing the appropriate variables below:

$serverName = $config['serverIP'];
$connectionInfo = array( "Database"=>$config[database], "UID"=>$config[user],  "PWD"=>$config[password]);
$conn = sqlsrv_connect( $serverName, $connectionInfo);

 

This code works great in 5.6.40, but fails in 7.3.8.

I am fairly new to utilizing PHP and MS SQL Server. I appreciate any insight/direction you can provide. Thank you.

 

 - MuadDib

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Employee
Employee
Solution

Re: PHP 7.3 Connection using sqlsrv_connect

I'm pretty sure you have gotten through this issue by now but would like to respond to be certain. It looks like the first thing you would want to do is make sure the MSSQL driver is loaded. If not you will need to load an extension compatible with the php version. I found this article that goes over the issue and resolution: https://stackoverflow.com/questions/48009654/connecting-php-7-2-to-ms-sql-using-sqlsrv. That should guide you in the right direction if you are still needing assistance.

Jena C | GoDaddy | Advanced Care | 24/7 support available at x.co/247support |

View solution in original post

1 REPLY 1
Highlighted
Employee
Employee
Solution

Re: PHP 7.3 Connection using sqlsrv_connect

I'm pretty sure you have gotten through this issue by now but would like to respond to be certain. It looks like the first thing you would want to do is make sure the MSSQL driver is loaded. If not you will need to load an extension compatible with the php version. I found this article that goes over the issue and resolution: https://stackoverflow.com/questions/48009654/connecting-php-7-2-to-ms-sql-using-sqlsrv. That should guide you in the right direction if you are still needing assistance.

Jena C | GoDaddy | Advanced Care | 24/7 support available at x.co/247support |

View solution in original post