原文参考连接:
http://www.hivemq.com/blog/mqtt-client-library-encyclopedia-mosquitto-php
1.mosquitto源码安装
源码下载位置:http://mosquitto.org/files/source/
选择版本mosquitto-1.4.9.tar.gz
将文件复制到linux系统某一位置
2.解压安装包,编辑config.mk文件屏蔽掉:
WITH_TLS、WITH_TLS_PSK
安装过程出现以下错误:
fatal error: ares.h: No such file or directory
解决方法安装:
apt-get install libc-ares-dev
又出现如下错误:
fatal error: uuid/uuid.h: No such file or directory
安装如下库:
apt-get install uuid-dev
最后 make install
安装完成,通过命令mosquitto启动服务;
启动服务命令:
service mosquitto status 查看服务状态
service mosquitto start 启动服务
service mosquitto stop 停止服务
如果出现未知状态说明已经停止
3.运行下面命令进行安装
pecl
mosquitto 扩展安装php客户端库
最新推荐文章于 2025-04-07 12:48:01 发布