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
- Install:
sudo apt install php8.2-gdand restart FPM - Docker:
docker-php-ext-configure gd --with-jpeg --with-webp && docker-php-ext-install gd - Check
gd_info()
Detailed fix by platform
Docker
- Install libjpeg/libwebp dev packages before configuring GD
How to diagnose
- Loaded — function_exists('imagecreatetruecolor')
- 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.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026