Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

159
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda