How To Install php-ZendFramework2-Json on CentOS 7

In this tutorial we learn how to install php-ZendFramework2-Json on CentOS 7. php-ZendFramework2-Json is Zend Framework 2: JSON Component

Introduction

In this tutorial we learn how to install php-ZendFramework2-Json on CentOS 7.

What is php-ZendFramework2-Json

Zend\Json provides convenience methods for serializing native PHP to JSON and decoding JSON to native PHP. JSON, JavaScript Object Notation, can be used for data interchange between JavaScript and other languages. Since JSON can be directly evaluated by JavaScript, it is a more efficient and lightweight format than XML for exchanging data with JavaScript clients. In addition, Zend\Json provides a useful way to convert any arbitrary XML formatted string into a JSON formatted string. This built-in feature will enable PHP developers to transform the enterprise data encoded in XML format into JSON format before sending it to browser-based Ajax client applications. It provides an easy way to do dynamic data conversion on the server-side code thereby avoiding unnecessary XML parsing in the browser-side applications. It offers a nice utility function that results in easier application-specific data processing techniques.

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

Install php-ZendFramework2-Json 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-ZendFramework2-Json using yum by running the following command:

sudo yum -y install php-ZendFramework2-Json

Install php-ZendFramework2-Json 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-ZendFramework2-Json using dnf by running the following command:

sudo dnf -y install php-ZendFramework2-Json

How To Uninstall php-ZendFramework2-Json on CentOS 7

To uninstall only the php-ZendFramework2-Json package we can use the following command:

sudo dnf remove php-ZendFramework2-Json

References

Summary

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