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

- **ID:** `php/composer-platform-req-fail`
- **领域:** php
- **类别:** install_error
- **验证级别:** ai_generated
- **修复率:** 90%

## 根因

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

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 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 | — | — |

## 解决方案

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`.
   ```

## 无效尝试

- **** — The platform requirement check is independent of plugins; `--no-plugins` only disables plugin scripts, not the requirement validation. (95% 失败率)
- **** — Composer reads the `require` section from `composer.json`; clearing cached files does not change the requirement. The extension must be installed first. (90% 失败率)
