{"record":{"id":"c1599427bbd205c6","repo":"yiisoft/yii2","slug":"either-gd-php-extension-with-freetype-support-or-i","errorCode":null,"errorMessage":"Either GD PHP extension with FreeType support or ImageMagick PHP extension with PNG support is required.","messagePattern":"Either GD PHP extension with FreeType support or ImageMagick PHP extension with PNG support is required\\.","errorType":"exception","errorClass":"yii\\base\\InvalidConfigException","httpStatus":null,"severity":"error","filePath":"framework/captcha/Captcha.php","lineNumber":175,"sourceCode":"     * This method will check the existence of ImageMagick and GD extensions.\n     * @return string the name of the graphic extension, either \"imagick\" or \"gd\".\n     * @throws InvalidConfigException if neither ImageMagick nor GD is installed.\n     */\n    public static function checkRequirements()\n    {\n        if (extension_loaded('imagick')) {\n            $imagickFormats = (new \\Imagick())->queryFormats('PNG');\n            if (in_array('PNG', $imagickFormats, true)) {\n                return 'imagick';\n            }\n        }\n        if (extension_loaded('gd')) {\n            $gdInfo = gd_info();\n            if (!empty($gdInfo['FreeType Support'])) {\n                return 'gd';\n            }\n        }\n        throw new InvalidConfigException('Either GD PHP extension with FreeType support or ImageMagick PHP extension with PNG support is required.');\n    }\n}\n","sourceCodeStart":157,"sourceCodeEnd":178,"githubUrl":"https://github.com/yiisoft/yii2/blob/66f00d18a29b520f85e8e8f1e32d1e7e7b556cac/framework/captcha/Captcha.php#L157-L178","documentation":"Error \"Either GD PHP extension with FreeType support or ImageMagick PHP extension with PNG support is required.\" thrown in yiisoft/yii2.","triggerScenarios":"Thrown at framework/captcha/Captcha.php:175 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"66f00d18a29b520f85e8e8f1e32d1e7e7b556cac","analyzedAt":"2026-08-17T05:17:23.470Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}