I’ve searched for this and the solutions provided in past questions are completely incomprehensible to me. Whenever I run functions like imagecreatefromjpeg
, I
After installing php5-gd
apache restart is needed.
sudo apt-get install phpx.x-gd
sudo service apache2 restart
x.x is the versión php.
In CentOS, RedHat, etc. use below command. don't forget to restart the Apache. Because the PHP module has to be loaded.
yum -y install php-gd
service httpd restart
Install GD Library
Which OS you are using?
http://php.net/manual/en/image.installation.php
Windows http://www.dmxzone.com/go/5001/how-do-i-install-gd-in-windows/
Linux http://www.cyberciti.biz/faq/ubuntu-linux-install-or-add-php-gd-support-to-apache/
If you are like me and you are using one of the PHP Docker images as your base, you need to add the gd extension using different instructions then what's discussed above.
For the php:7.4.1-apache
image you need to add in your Dockerfile
:
RUN apt-get update && \
apt-get install -y zlib1g-dev libpng-dev libjpeg-dev
RUN docker-php-ext-configure gd --with-jpeg && \
docker-php-ext-install gd
These dev packages are needed for compilation of the GD php extension. For me this resulted in activation of GD with PNG and JPEG support in PHP.