Not able to install composer

curl -sS https://getcomposer.org/installer | sudo php -- --install- dir=/usr/local/bin --filename=composer 

When I run the above command in terminal I got this this response:

Some settings on your machine make Composer unable to work properly.
Make sure that you fix the issues listed below and run this script again:

The json extension is missing.
Install it or recompile php without --disable-json

The phar extension is missing.
Install it or recompile php without --disable-phar

The iconv OR mbstring extension is required and both are missing.
Install either of them or recompile php without --disable-iconv

In Ubuntu 16.04 and later composer can be installed from the default Ubuntu repositories. Open the terminal and type:

sudo apt install composer  

This command will also install the required PHP and JSON dependency packages along with it. Composer dependency manager for PHP helps you declare, manage and install dependencies of PHP projects, ensuring you have the right stack everywhere.