{
  "id": "php/composer-platform-req-fail",
  "signature": "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.",
  "signature_zh": "您的要求无法解析为可安装的软件包集合。问题1 - 根composer.json要求PHP扩展ext-gd *，但您的系统中缺少该扩展。请安装或启用PHP的gd扩展。",
  "regex": "Your\\s+requirements\\s+could\\s+not\\s+be\\s+resolved\\s+to\\s+an\\s+installable\\s+set\\s+of\\s+packages\\.\\s+Problem\\s+1\\s+-\\s+Root\\s+composer\\.json\\s+requires\\s+PHP\\s+extension\\s+ext-",
  "domain": "php",
  "category": "install_error",
  "subcategory": null,
  "root_cause": "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.",
  "root_cause_type": "generic",
  "root_cause_zh": "Composer检测到当前PHP运行时中未安装或启用所需的PHP扩展（ext-gd），由于平台要求而阻止软件包安装。",
  "versions": [
    {
      "version": "Composer 2.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Composer 2.5",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Composer 2.6",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "PHP 7.4",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "PHP 8.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "PHP 8.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "PHP 8.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The platform requirement check is independent of plugins; `--no-plugins` only disables plugin scripts, not the requirement validation.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Composer reads the `require` section from `composer.json`; clearing cached files does not change the requirement. The extension must be installed first.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "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.",
      "success_rate": 0.95,
      "how": "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.",
      "condition": "",
      "sources": []
    },
    {
      "action": "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`.",
      "success_rate": 0.85,
      "how": "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`.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "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.",
    "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`."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://getcomposer.org/doc/articles/troubleshooting.md#platform-requirements",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2023-06-01",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}