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.
Call to undefined function imagecreatefromjpegCall to undefined function imagecreatetruecolor 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 not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in PHP
Other ways to find it
Where this error sits
Origin: Application & API. Errors that are often confused with or caused by this one (click to open):
🧠 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.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 12 Oct 2026