About php code

Hello, I want to start my server through a website with a button, but I cannot start it. I cannot use this button when the server is down. How can I use this button even if the server is down?


    $stmt = $pdo->prepare("SELECT * FROM servers WHERE id = :id");

    $stmt->bindParam(':id', $sunucu_id);


    $row = $stmt->fetch(PDO::FETCH_ASSOC);

             $islem_mesaj = "<span class='alert alert-success rounded-5 d-flex justify-content-center'>Sunucu başarıyla başlatıldı!</span>";



             $tsip = $row['tsip'];

             $queryport = $row['queryport'];

             $useradi = $row['useradi'];

             $querypass = $row['querypass'];

             $port = $row['port'];


             $ts3_VirtualServer = TeamSpeak3::factory("serverquery://$useradi:$querypass@$tsip:$queryport/?server_port=$port&blocking=0");

             $sunucu_id = $ts3_VirtualServer->serverIdGetByPort($port);


Well it depends on how TeamSpeak is running in general.
When the service itself is not running it obviously cannot handle query requests.
If TS is running natively on the host you will need to exec the startscript first.
If it is running in a docker container you will need to exec a docker start command first.

The server is running all the time. I just want to do the start process on the yatqa on my website.

in this way

I think the whole thing is not possible without a connection via ssh because, as Gamer already said, you have to execute a StartScript to start the server.