Registry / networking / php-mqtt-client

php-mqtt-client

JSON →
library2.3.2phppackagistunverified

An MQTT client written in and for PHP.

composer require php-mqtt/client
INSTALL
IMPORT
SIG · PHP-MQTT-CLIENT
P
php-mqtt-client
networkingphpv2.3.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MqttClient
✓ use PhpMqtt\Client\MqttClient;

Connect to an MQTT broker and subscribe to a topic.

use PhpMqtt\Client\MqttClient; $client = new MqttClient('broker.example.com', 1883); $client->connect(); $client->subscribe('test/topic', function ($topic, $message) { echo "Received: $message"; }); $client->loop(true);
Debug
Known issues
breakingRequires PHP 7.4+ and ext-mosquitto or ext-sockets
fix
Install required PHP extensions (mosquitto or sockets) and ensure PHP version >= 7.4
affects: >=2.0.0
Upgrade
Version history
2.3.2latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
19 hits · last 30 days
node
16
Amazon
1
OpenAI (training)
1
Resources
php-mqtt-client — pip install php-mqtt-client · libregistry