GD missing 🐘 PHP

Fatal error: Uncaught Error: Call to undefined function imagecreatefromjpeg()

The GD extension (or its JPEG/WebP support) isn’t installed for the PHP version serving the site.

Seen on: PHP

Meaning

Image resizing, captchas and thumbnails need GD (or Imagick). PHP may be compiled without JPEG/WebP support even if GD exists.

Common causes

  • php-gd not installed
  • GD built without JPEG/WebP
  • Different PHP version for web vs CLI

⚡ Quick fix

  1. Install: sudo apt install php8.2-gd and restart FPM
  2. Docker: docker-php-ext-configure gd --with-jpeg --with-webp && docker-php-ext-install gd
  3. Check gd_info()

Detailed fix by platform

Docker

  1. Install libjpeg/libwebp dev packages before configuring GD

How to diagnose

  1. Loaded — function_exists('imagecreatetruecolor')
  2. Formats — gd_info() JPEG/WebP support

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.