Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

169
Visualizações
How can i send command to screen using php?

I'm using this code to send command via RCON to a game server, with this library.

This is my actual code:

<?php
    require __DIR__ . 'SourceQuery/bootstrap.php';
    use xPaw\SourceQuery\SourceQuery;

    define( 'SQ_SERVER_ADDR', 'my ip' );
    define( 'SQ_SERVER_PORT', 27015 );
    define( 'SQ_TIMEOUT',     1 );
    define( 'SQ_ENGINE',      SourceQuery::SOURCE );

    $Query = new SourceQuery( );

    try
    {
        $Query->Connect( SQ_SERVER_ADDR, SQ_SERVER_PORT, SQ_TIMEOUT, SQ_ENGINE );

        $Query->SetRconPassword( 'my pass' );

        var_dump( $Query->Rcon( 'the command' ) );
    {
        $Query->Disconnect( );
    }
?>

But for example if I want to stop the server I can just send the command "quit" through rcon, but how about starting the server? My idea was that I can send this command once I press a button (the server is on the same machine as the website), but with this piece of code it does not work:

exec('screen -p 0 -S csgo -X eval \'stuff "./scds_run other parameters"\\015\' ');
over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda