How To Install php-pecl-cairo on CentOS 7

In this tutorial we learn how to install php-pecl-cairo on CentOS 7. php-pecl-cairo is PECL package for drawing using cairo via PHP scripts

Introduction

In this tutorial we learn how to install php-pecl-cairo on CentOS 7.

What is php-pecl-cairo

PECL cairo is the official Cairo Graphics Library binding. It provides an object oriented and procedural interface for the cairo library. Support is currently provided for 1.4 to 1.8 versions of the library (1.10 is partially supported).

We can use yum or dnf to install php-pecl-cairo on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install php-pecl-cairo.

Install php-pecl-cairo on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install php-pecl-cairo using yum by running the following command:

sudo yum -y install php-pecl-cairo

Install php-pecl-cairo on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install php-pecl-cairo using dnf by running the following command:

sudo dnf -y install php-pecl-cairo

How To Uninstall php-pecl-cairo on CentOS 7

To uninstall only the php-pecl-cairo package we can use the following command:

sudo dnf remove php-pecl-cairo

References

Summary

In this tutorial we learn how to install php-pecl-cairo on CentOS 7 using yum and dnf.