I tried to install the CURL in my server but failed. My server is running in Ubuntu 18.04 LTS & PHP 7.2 version. I used the command to install the CURL in my server.

The command I used:

  1. sudo apt-get install curl
  2. sudo service apache2 restart I restart my server using this command
  3. sudo apt-get install php7.2-curl
  4. sudo service apache2 restart Again I restarted my server.

But after this nothing works. The CURL Command is not executing.

curl https://api.example.com/foo/foo/

The output is nothing, Is there any way to install the CURL which is compatible with PHP7.2 version.

  • I followed this article, Now I enabled the CURL in the latest version of PHP7.2 – Razor Rassh Jul 23 '19 at 20:19

I tried this and it worked for me!

$ sudo apt-get install curl
$ sudo apt update
$ sudo add-apt-repository ppa:ondrej/php
$ sudo apt install php7.2-curl php7.2-mysql php7.2-dev php7.2-cli php7.2-intl
$ sudo service apache2 restart

Need to use the following commands:

  1. sudo add-apt-repository ppa:ondrej/php
  2. sudo apt update
  3. sudo apt install php7.2-fpm php7.2-gd php7.2-curl php7.2-mysql php7.2-dev php7.2-cli php7.2-common php7.2-mbstring php7.2-intl php7.2-zip php7.2-bcmath

Then need to restart my server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.