SQLServer 2012 - PHP 7.0, Cant run PHP script

Problems with the Windows version of XAMPP, questions, comments, and anything related.

SQLServer 2012 - PHP 7.0, Cant run PHP script

Postby deepak009 » 21. August 2018 14:57

Hello,
I started using xampp server last month, However, I can not find a solution to this problem anywhere. I followed all the videos on youtube. If anyone can help with this problem, I will deeply appreciate it.
Problem:
Run connection string for SQL Server but does not connect to PHP webpage, it only shows the code on the webpage.

(My guess is, I need to configure in the system of SQL server which can let me connect the SQL server through PHP)


Already Ran attempts.
1.) Run Xamp as Administratior.
2.) Install proper drivers (Installed works fine as well as can see it active on Php.Info() - SQLSRV (4.1 version) , I also tried SQLSRV(5.3 version)
3.) Configure PORTS which might be blocking the connection (Checked nothing interfering, Running Apache port on 8080)
4.) Create Connection String and see bugs ( Here is the connection string, I checked the appropriate configuration for this problem, DB connection and server credentials are fine.

<?php
$serverName = "serverName\\sqlexpress"; //serverName\instanceName
$connectionInfo = array( "Database"=>"dbName", "UID"=>"userName", "PWD"=>"password");
$conn = sqlsrv_connect( $serverName, $connectionInfo);

if( $conn ) {
echo "Connection established.<br />";
}else{
echo "Connection could not be established.<br />";
die( print_r( sqlsrv_errors(), true));
}
?>

5.) configure php_odbc.dll configuration, i also checked that problem, didnt work.

----------------------------------------------------------------------------------------------------------------

Thank you
Sincerely
deepak009
 
Posts: 1
Joined: 21. August 2018 14:40
XAMPP version: 7.0
Operating System: Windows 10

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 92 guests