Skip to main content

解决composer报错

错误一

报错信息:

SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

问题原因:

证书问题,也有可能是系统的时间不正确。

解决方案:

检查是不是证书问题,并且重新校对系统时间。

错误二

报错信息:

Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]? yes
./composer.json has been updated
Running composer update bluerhinos/phpmqtt
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1
- phpoffice/phpspreadsheet is locked to version 1.12.0 and an update of this package was not requested.
- phpoffice/phpspreadsheet 1.12.0 requires ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension.
Problem 2
- overtrue/wechat is locked to version 4.2.11 and an update of this package was not requested.
- overtrue/wechat 4.2.11 requires ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension.

To enable extensions, verify that they are enabled in your .ini files:
- /usr/local/php/72/etc/php.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-fileinfo` to temporarily ignore these required extensions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require bluerhinos/phpmqtt:*" to figure out if any version is installable, or "composer require bluerhinos/phpmqtt:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

问题原因:

有些包依赖fileinfo扩展,当前系统找不到扩展,或者没有安装此扩展。

解决方案:

可以安装依赖的php扩展,或者使用--ignore-platform-req命令忽略此扩展。如:

composer --ignore-platform-req=ext-fileinfo require bluerhinos/phpmqtt