Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

158
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!