还没有链接 就报错了
public function onWorkerStart()
{
var_dump(getenv('MQTT_HOST') . ':' . getenv('MQTT_PORT'));
var_dump(getenv('MQTT_USER') . ':' . getenv('MQTT_PASSWORD'));
$mqtt = new Client(getenv('MQTT_HOST') . ':' . getenv('MQTT_PORT'), [
'username' => getenv('MQTT_USER'),
'password' => getenv('MQTT_PASSWORD'),
]);
}
Fatal error: Declaration of Workerman\Mqtt\Protocols\Mqtt::input(string $buffer, Workerman\Connection\ConnectionInterface $connection): int must be compatible with Workerman\Protocols\ProtocolInterface::input($recv_buffer, Workerman\Connection\ConnectionInterface $connection) in /Users/zhengjiefeng/yujianshanhai/api-device-dept/vendor/workerman/mqtt/src/Protocols/Mqtt.php on line 134
macos
php8.3
提问时把workerman 和 mqtt版本发下。
composer info
能看到版本信息