php install_error ai_generated true

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

Also available as: JSON · Markdown · 中文
90%Fix Rate
87%Confidence
1Evidence
2023-06-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
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

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.

generic

中文

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

Official Documentation

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

Workarounds

  1. 95% success 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.
    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. 85% success 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`.
    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. 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`.

Dead Ends

Common approaches that don't work:

  1. 95% fail

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

  2. 90% fail

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