PHPackages                             anvilm/php.rcon - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. anvilm/php.rcon

ActivePackage[Utility &amp; Helpers](/categories/utility)

anvilm/php.rcon
===============

PHP RCON Client

v2.0.2(1y ago)025MITPHPPHP &gt;=7.1

Since Mar 6Pushed 1y ago1 watchersCompare

[ Source](https://github.com/AnvilM/php.rcon)[ Packagist](https://packagist.org/packages/anvilm/php.rcon)[ RSS](/packages/anvilm-phprcon/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (12)Used By (0)

About
-----

[](#about)

This package is a client that supports some implementations of the RCON protocol. [About RCON](https://developer.valvesoftware.com/wiki/Source_RCON_Protocol)

Installation
------------

[](#installation)

You can get this package using composer

```
composer require anvilm/php.rcon
```

Basic Usage
-----------

[](#basic-usage)

### Create a client

[](#create-a-client)

```
use AnvilM\RCON\Clients\Minecraft\MinecraftClient;

$Ip = '127.0.0.1'; //Server IP
$Port = 25575; //RCON port

$Client = new MinecraftClient($Ip, $Port);
```

### Authentication

[](#authentication)

Before sending commands you need to authenticate:

```
$Password = '123' // RCON Password

$Client->authenticate($Password);
```

### Send commands

[](#send-commands)

To send a command you need to call the sendCommand method:

```
$Client->sendCommand('time set day');
```

### Available clients:

[](#available-clients)

- **Minecraft**

Base RCON Client
----------------

[](#base-rcon-client)

If you want to create your own client, you can use RconClient to exchange packets with the server.

### RCON Entity

[](#rcon-entity)

RCON Entity is an object that acts as a DTO and contains data for sending a command and a response from the server, since they use the same structure.

```
use AnvilM\RCON\Entity\RCON

$data = new RCON(
    1, // packet id, the response will have the same id
    2 // packet type, may vary by implementation
    'time set day' // command
);
```

### Request method

[](#request-method)

Request method sends a command to the server and waits for a response, if $timeout is not specified it will wait 5 seconds, if a response has arrived it will return an RCON object with the response data.

```
use AnvilM\RCON\RCONClient;
use AnvilM\RCON\Entity\RCON;

$client = new RCONClient('127.0.0.1', 25575);

// Minecraft authorization
$data = new RCON(1, 3, '123');

// Returns new RCON(1, 2, '')
$response = $client->request($data);
```

Connections
-----------

[](#connections)

This package uses [php.transport](https://github.com/AnvilM/php.transport) so you can manage connections and sockets.

To get the current connection use this method:

```
use AnvilM\RCON\RCONClient;

$client = new RCONClient('127.0.0.1', 25575);

$connection = $client->getConnection();
```

For example, you can close and open connections, but in this case you will have to authenticate again.

```
// Close connection and create new socket
$connection->close();

// Open connection with new socket
$connection->open()

// Auth with new socket
$client->request(
    new RCON(1, 3, '123')
);
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance41

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~34 days

Recently: every ~77 days

Total

10

Last Release

495d ago

Major Versions

v1.2 → v2.0.02025-01-07

PHP version history (2 changes)v1.0.0PHP ^8.1

v2.0.0PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/d6be63d2e00c01cda03e8e0a314d1714133bc0839da7adb72ef75afa8e7972af?d=identicon)[AnvilM](/maintainers/AnvilM)

---

Top Contributors

[![AnvilM](https://avatars.githubusercontent.com/u/94012493?v=4)](https://github.com/AnvilM "AnvilM (16 commits)")

---

Tags

rconMinecarft

### Embed Badge

![Health badge](/badges/anvilm-phprcon/health.svg)

```
[![Health](https://phpackages.com/badges/anvilm-phprcon/health.svg)](https://phpackages.com/packages/anvilm-phprcon)
```

###  Alternatives

[thedudeguy/rcon

Simple Rcon class for php.

16259.4k1](/packages/thedudeguy-rcon)[rupadana/filament-slider

Slide into Precision – Customizable Control at Your Fingertips.

1221.3k](/packages/rupadana-filament-slider)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
