[php] CentOS: Enabling GD Support in PHP Installation

How do I go about enabling GD Support in a CentOS Installation?

This question is related to php linux cakephp gd centos

The answer is


For PHP7 on CentOS or EC2 Linux AMI:

sudo yum install php70-gd

With CentOS 6.5+ and PHP 5.5:

yum install php55u-gd
service httpd restart

If you get an error like: cannot map zero-fill pages: Cannot allocate memory in Unknown on line 0, it could be because you don't have a swap file. I suggest you take a look at the tutorial mentioned in this answer: https://stackoverflow.com/a/20275282/828366

Tutorial: https://www.digitalocean.com/community/articles/how-to-add-swap-on-centos-6


Put the command

yum install php-gd

and restart the server (httpd, nginx, etc)

service httpd restart

  1. You need to find a repo that offers a GD lib matching your current php version. I've had great success using Remi Collet's repo for this purpose. In fact, I used it yesterday to update my php install to the latest 5.4.0RC6 version on my CentOS6 box.
  2. Once you've setup the repo it's a simple matter of running sudo yum install php-gd
  3. Of course, the usual things apply: make sure you restart apache after installing, etc.

CentOs 6.5+ & PHP 5.6:

sudo yum install php56-gd

service httpd restart

Examples related to php

I am receiving warning in Facebook Application using PHP SDK Pass PDO prepared statement to variables Parse error: syntax error, unexpected [ Preg_match backtrack error Removing "http://" from a string How do I hide the PHP explode delimiter from submitted form results? Problems with installation of Google App Engine SDK for php in OS X Laravel 4 with Sentry 2 add user to a group on Registration php & mysql query not echoing in html with tags? How do I show a message in the foreach loop?

Examples related to linux

grep's at sign caught as whitespace How to prevent Google Colab from disconnecting? "E: Unable to locate package python-pip" on Ubuntu 18.04 How to upgrade Python version to 3.7? Install Qt on Ubuntu Get first line of a shell command's output Cannot connect to the Docker daemon at unix:/var/run/docker.sock. Is the docker daemon running? Run bash command on jenkins pipeline How to uninstall an older PHP version from centOS7 How to update-alternatives to Python 3 without breaking apt?

Examples related to cakephp

SQLSTATE[HY000] [1045] Access denied for user 'username'@'localhost' using CakePHP CakePHP 3.0 installation: intl extension missing from system How to check not in array element 404 Not Found The requested URL was not found on this server What is /var/www/html? Request exceeded the limit of 10 internal redirects due to probable configuration error how we add or remove readonly attribute from textbox on clicking radion button in cakephp using jquery? PHP Fatal error: Class 'PDO' not found Undefined variable: $_SESSION CentOS: Enabling GD Support in PHP Installation

Examples related to gd

Extension gd is missing from your system - laravel composer Update Install GD library and freetype on Linux imagecreatefromjpeg and similar functions are not working in PHP Creating a thumbnail from an uploaded image CentOS: Enabling GD Support in PHP Installation Enabling/installing GD extension? --without-gd Crop image in PHP

Examples related to centos

How to uninstall an older PHP version from centOS7 Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details pip install - locale.Error: unsupported locale setting ssh : Permission denied (publickey,gssapi-with-mic) How to change the MySQL root account password on CentOS7? Completely remove MariaDB or MySQL from CentOS 7 or RHEL 7 ffprobe or avprobe not found. Please install one How to check all versions of python installed on osx and centos Cannot find java. Please use the --jdkhome switch VirtualBox: mount.vboxsf: mounting failed with the error: No such device