【付费求助】系统之前用的workerman框架,现在需要增加 mqtt ;求助!!!

pxfaizy

问题描述

已经实现了tcp/ip连接设备,现在需要增加mqtt方式;实现数据的读写。

为此你搜索到了哪些方案及不适用的原因

试了composer require workerman/mqtt 一直报错,装不了,也不清楚具体问题在哪里;composer 已安装,

Composer version 2.6.6 2023-12-08 18:32:26

814 5 0
5个回答

pxfaizy

联系方式:wx:pxfaizy

  • 暂无评论
pxfaizy

composer require workerman/mqtt:dev-master 这个也试了

  • 暂无评论
walkor 打赏

提问要尽量详细,有报错发完整的具体报错

  • pxfaizy 2024-02-18

    Welcome to Alibaba Cloud Elastic Compute Service !

    [root@iZ5idcd7hxknovZ ~]# composer require workerman/mqtt --ignore-platform-reqs
    PHP Warning: PHP Startup: curl: Unable to initialize module
    Module compiled with module API=20100525
    PHP compiled with module API=20190902
    These options need to match
    in Unknown on line 0

    Installation failed, deleting ./composer.json.

    In RequireCommand.php line 225:

    No composer.json present in the current directory (./composer.json), this m
    ay be the cause of the following exception.

    In PackageDiscoveryTrait.php line 356:

    Could not find package workerman/mqtt. It was however found via repository
    search, which indicates a consistency issue with the repository.

    require [--dev] [--dry-run] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--fixed] [--no-suggest] [--no-progress] [--no-update] [--no-install] [--no-audit] [--audit-format AUDIT-FORMAT] [--update-no-dev] [-w|--update-with-dependencies] [-W|--update-with-all-dependencies] [--with-dependencies] [--with-all-dependencies] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--] [<packages>...]

    [root@iZ5idcd7hxknovZ ~]# composer require workerman/mqtt:dev-master --ignore-platform-reqs
    PHP Warning: PHP Startup: curl: Unable to initialize module
    Module compiled with module API=20100525
    PHP compiled with module API=20190902
    These options need to match
    in Unknown on line 0
    ./composer.json has been created
    Running composer update workerman/mqtt
    Loading composer repositories with package information
    Updating dependencies
    Your requirements could not be resolved to an installable set of packages.

    Problem 1

    • Root composer.json requires workerman/mqtt, it could not be found in any version, there may be a typo in the package name.

    Potential causes:

    Read https://getcomposer.org/doc/articles/troubleshooting.md for further common problems.

    Installation failed, deleting ./composer.json.
    [root@iZ5idcd7hxknovZ ~]#

  • pxfaizy 2024-02-18

    不知道怎么贴图片,我把信息都复制过来了

  • 不败少龙 2024-02-18

    就是编辑你的问题 在里面把截图放进去

  • walkor 2024-02-18

    执行 composer config -g --unset repos.packagist 删除composer代理

  • pxfaizy 2024-02-18

    成功了,非常感谢;已赞助,一点心意;新年快乐,万分感谢!!!

不败少龙

php7,8都安装了 没有遇到什么问题 是不是你其他的扩展导致的哦
在后面加上 --ignore-platform-reqs这个试试呢

  • pxfaizy 2024-02-18

    加了还是不成功呢

  • pxfaizy 2024-02-18

    我的是 PHP 7.4.15 (cli) (built: Feb 21 2021 11:34:37) ( NTS )

pxfaizy

统一回复,问题已解决,谢谢大家

  • 暂无评论
×
🔝