Question

Can't figure out how to install php-gd for PHP7 with yum

I followed this tutorial for upgrading my droplet with a LEMP stack to PHP7:

https://www.digitalocean.com/community/tutorials/how-to-upgrade-to-php-7-on-centos-7

However, I’ve since realised that GD Library isn’t running, as it wasn’t included with the standard PHP installation. Testing it on a Wordpress install on my droplet, the image uploads, but no other sizes are created. I’ve since found this question:

https://www.digitalocean.com/community/questions/is-there-a-php-gd-command-for-php7

…which details using apt-get to install php-gd for PHP7, but I can’t find anything that works for yum. I am pretty new to server setups so I’m stumbling around in the dark a bit here.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

I should have paid more attention to the naming convention - even though I couldn’t find GD Library in IUS’s package list, it is there. I just ran:

sudo yum install php70u-gd

It wasn’t until I tried grabbing a list of all installed PHP packages that I noticed the naming convention was probably key. If anyone is curious about their own installation, you can run:

yum list installed *php*

After some struggle trying to get the package right for centos it wound up being: yum install php-gd

The other packages are not available any more.

I have it installed on my centos 7 droplet, currently running php 7.1.5

Package name is php71w-gd

I’m using the Webtatic repo: https://webtatic.com/packages/php71/

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.