0

iis manager running with php 7.3.11

i have a mssql 2019 server running server name: "DESKTOP-JM2VQLE" db name: "base"

and i have this php script

    <title>Hey</title>
 Heyb

<?php
echo "unt";
    $serverName = "DESKTOP-JM2VQLE";
echo $serverName;
    $connectionOptions = array(
        "Database" => "SQL_DATABASE.KinkyDatabase",
        "Uid" => "Test",
        "PWD" => "Parkour132"
    );
    //Establishes the connection
    $conn = sqlsrv_connect($serverName, $connectionOptions);
echo $conn;
echo "Test";
    if($conn)
        echo "Connected!"
?>

When i go on the website or run it using php.exe in command line i get this

C:\Users\TEST>f:\PHP\php.exe "f:\Servers\New folder\index.php"
 <title>Hey</title>
 Heyb

untDESKTOP-JM2VQLETest

I cant get any conection to my server

C:\Users\TEST>f:\PHP\php.exe "f:\Servers\New folder\index.php"
 <title>Hey</title>
 Heyb

untDESKTOP-JM2VQLETestArray
(
    [0] => Array
        (
            [0] => 08001
            [SQLSTATE] => 08001
            [1] => 2
            [code] => 2
            [2] => [Microsoft][ODBC Driver 17 for SQL Server]Named Pipes Provider: Could not open a connection to SQL Server [2].
            [message] => [Microsoft][ODBC Driver 17 for SQL Server]Named Pipes Provider: Could not open a connection to SQL Server [2].
        )

    [1] => Array
        (
            [0] => HYT00
            [SQLSTATE] => HYT00
            [1] => 0
            [code] => 0
            [2] => [Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired
            [message] => [Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired
        )

    [2] => Array
        (
            [0] => 08001
            [SQLSTATE] => 08001
            [1] => 2
            [code] => 2
            [2] => [Microsoft][ODBC Driver 17 for SQL Server]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.
            [message] => [Microsoft][ODBC Driver 17 for SQL Server]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.
        )

)
3

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.