imagecreatefromjpeg and similar functions are not working in PHP imagecreatefromjpeg and similar functions are not working in PHP php php

imagecreatefromjpeg and similar functions are not working in PHP


In Ubuntu/Mint (Debian based)

$ sudo apt-get install php5-gd


You can still get Fatal error: Call to undefined function imagecreatefromjpeg() even if GD is installed.

The solution is to install/enable jped lib:

On Ubuntu:

    apt-get install libjpeg-dev    apt-get install libfreetype6-dev

On CentOS:

    yum install libjpeg-devel    yum install freetype-devel

If compiling from source add --with-jpeg-dir --with-freetype-dir or --with-jpeg-dir=/usr --with-freetype-dir=/usr.

For more details check https://www.tectut.com/2015/10/solved-call-to-undefined-function-imagecreatefromjpeg/