How To Install php-services-json on Ubuntu 18.04

In this tutorial we learn how to install php-services-json on Ubuntu 18.04. php-services-json is PHP implementaion of json_encode/decode

Introduction

In this tutorial we learn how to install php-services-json on Ubuntu 18.04.

What is php-services-json

php-services-json is:

JSON (JavaScript Object Notation, http://json.org) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition - December 1999. This feature can also be found in Python. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Tcl, and many others. These properties make JSON an ideal data-interchange language.

This package provides a simple encoder and decoder for JSON notation. It is intended for use with client-side Javascript applications that make use of HTTPRequest to perform server communication functions - data can be encoded into JSON notation for use in a client-side javascript, or decoded from incoming Javascript requests. JSON format is native to Javascript, and can be directly eval()’ed with no further parsing overhead.

There are three methods to install php-services-json on Ubuntu 18.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install php-services-json Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install php-services-json using apt-get by running the following command:

sudo apt-get -y install php-services-json

Install php-services-json Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install php-services-json using apt by running the following command:

sudo apt -y install php-services-json

Install php-services-json Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install php-services-json using aptitude by running the following command:

sudo aptitude -y install php-services-json

How To Uninstall php-services-json on Ubuntu 18.04

To uninstall only the php-services-json package we can use the following command:

sudo apt-get remove php-services-json

Uninstall php-services-json And Its Dependencies

To uninstall php-services-json and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove php-services-json

Remove php-services-json Configurations and Data

To remove php-services-json configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge php-services-json

Remove php-services-json configuration, data, and all of its dependencies

We can use the following command to remove php-services-json configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge php-services-json

References

Summary

In this tutorial we learn how to install php-services-json package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.