php install_error ai_generated true

您的要求无法解析为可安装的软件包集合。问题1 - 根composer.json要求PHP扩展ext-gd *,但您的系统中缺少该扩展。请安装或启用PHP的gd扩展。

Your requirements could not be resolved to an installable set of packages. Problem 1 - Root composer.json requires PHP extension ext-gd * but it is missing from your system. Install or enable PHP's gd extension.

ID: php/composer-platform-req-fail

其他格式: JSON · Markdown 中文 · English
90%修复率
87%置信度
1证据数
2023-06-01首次发现

版本兼容性

版本状态引入弃用备注
Composer 2.2 active
Composer 2.5 active
Composer 2.6 active
PHP 7.4 active
PHP 8.0 active
PHP 8.1 active
PHP 8.2 active

根因分析

Composer检测到当前PHP运行时中未安装或启用所需的PHP扩展(ext-gd),由于平台要求而阻止软件包安装。

English

Composer detects that a required PHP extension (ext-gd) is not installed or enabled in the current PHP runtime, preventing package installation due to platform requirements.

generic

官方文档

https://getcomposer.org/doc/articles/troubleshooting.md#platform-requirements

解决方案

  1. Install the missing PHP extension: for Ubuntu/Debian, run `sudo apt-get install php8.2-gd` then restart PHP-FPM `sudo systemctl restart php8.2-fpm`. For CentOS/RHEL, run `sudo yum install php-gd` and restart Apache or PHP-FPM.
  2. If the extension is already installed but not enabled, check `php.ini` for `extension=gd` or `extension=gd.so`, uncomment it, and restart PHP. Also verify with `php -m | grep gd`.

无效尝试

常见但无效的做法:

  1. 95% 失败

    The platform requirement check is independent of plugins; `--no-plugins` only disables plugin scripts, not the requirement validation.

  2. 90% 失败

    Composer reads the `require` section from `composer.json`; clearing cached files does not change the requirement. The extension must be installed first.