12_23

发布时间 2023-12-23 12:39:14作者: ╰(‵□′)╯

使用composer install 报错问题如下:

Your requirements could not be resolved to an installable set of packages.


  Problem 1
    - lpilp/guomi[v1.0.0, ..., v1.0.2] require mdanter/ecc 0.5.2 -> satisfiable by mdanter/ecc[v0.5.2].
    - lpilp/guomi[1.0.3, ..., v1.0.8] require mdanter/ecc ^1.0 -> satisfiable by mdanter/ecc[v1.0.0].
    - mdanter/ecc[v0.5.2, v1.0.0] require ext-gmp * -> it is missing from your system. Install or enable PHP's gmp extension.
    - Root composer.json requires lpilp/guomi ^1.0 -> satisfiable by lpilp/guomi[v1.0.0, ..., v1.0.8].


To enable extensions, verify that they are enabled in your .ini files:
    - E:\phpEnv\php\php-7.4\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-gmp` to temporarily ignore these required extensions.

解决问题办法:

这个错误信息表明,你的 PHP 环境中缺少 gmp 扩展,而一些你尝试安装的包(在这种情况下是 lpilp/guomi 和 mdanter/ecc)需要这个扩展。

要解决这个问题,你需要安装或启用 PHP 的 gmp 扩展。具体操作方法取决于你的操作系统。在 Linux 上,你可能需要安装 gmp 库。在 Windows 上,你需要修改 php.ini 文件来启用 gmp 扩展。

如果你在 Linux 上,你可以使用包管理器(如 apt 或 yum)来安装 gmp 库。例如,在 Ubuntu 上,你可以运行以下命令:

bash
sudo apt-get install php-gmp
如果你在 Windows 上,你需要找到 php.ini 文件并添加或取消注释(删除行首的分号)以下行:

ini
extension=gmp
保存文件后,重启你的 web 服务器(例如 Apache 或 Nginx)或 PHP 进程以使更改生效。

另外,你还可以选择在运行 Composer 时忽略平台要求,使用 --ignore-platform-req=ext-gmp 参数。这将使 Composer 忽略缺少 gmp 扩展的问题,但请注意,这可能会导致你安装的包无法正常工作。

解决后就能正常使用了:

2 fiddler 官网
https://www.telerik.com/fiddler