First thing to do: Check for the PHP version your machine is running.
Command Line: php -version
This will show something like this (in my case):
PHP 7.0.8-0ubuntu0.16.04.3 (cli) ( NTS ) Copyright (c) 1997-2016 The PHP Group
If you are using PHP 5.x.x => run command: sudo apt-get install php5-curl
If PHP 7.x.x => run command (in my case): sudo apt-get install php7.0-curl
Enable this extension by running:
sudo gedit /etc/php/7.0/cli/php.ini
And in the file "php.ini" search for keyword "curl" to find this line below and change it from
;extension=php_curl.dll
To:
extension=php_curl.dll
Next, save your file "php.ini".
Finally, in your command line, restart your server by running: sudo service apache2 restart
.