Imagecreatefromjpeg and similar functions do not work in PHP

I was looking for this, and the solutions provided in past issues are completely incomprehensible to me. Whenever I run functions like imagecreatefromjpeg , I get the following:

Fatal error: function call undefined imagecreatefromjpeg () ...

Im working on a new installation of PHP; my last install never had this problem. I do not understand what's going on.

+47
php gd
Nov 12
source share
7 answers

On Ubuntu / Mint (based on Debian)

 $ sudo apt-get install php5-gd 
+46
Feb 04 '14 at 2:36 on
source share

You must enable the GD2 library.

Find your (correct) php.ini file

Find the line :; extension = php_gd2.dll and remove the semicolon in front.

The line should look like this:

 extension=php_gd2.dll 

Then restart apache and you should be good to go.

+10
Nov 12 '12 at 4:27
source share

After installing php5-gd , a restart of Apache is required .

+7
May 31 '14 at 7:16
source share

For php 7 on Ubuntu:

sudo apt-get install php7.0-gd

+5
May 25 '17 at 14:17
source share
 sudo apt-get install phpx.x-gd sudo service apache2 restart 

xx is the php version.

+4
Sep 21 '16 at 9:39
source share

On CentOS, RedHat, etc. use the command below. Remember to restart Apache. Because the PHP module must be loaded.

 yum -y install php-gd service httpd restart 
+3
Aug 12 '14 at 19:15
source share



All Articles