How to enable PHP-cURL on Linux Ubuntu?

php-curl

There are lots of ways/posts available over the internet to describe the process of stitching the php-curl version through the terminal if we have multiple PHPs installed in our system. But, most of them are complex and not easy to remember to follow step by step if try to implement them on our own after some particular time especially when we don’t have the reference URL saved in our browser history to pick them faster. I have created a few steps here which are easy to remember and follow, especially for Linux Ubuntu. To enable the PHP-curl on Linux ubuntu, you need to install the package using this. Also, I have used it for the single PHP version on my system, but if you want to use it for a specific PHP version let’s say PHP 7.2 then replace the php-curl --- php7.2-curl

  
sudo apt-get install php-curl

for PHP 7.2

sudo apt-get install php7.2-curl

This will install a dependency package, which depends on the default PHP version.

Now restart your apache:

sudo service apache2 restart

You can see if curl is activated:

php -i | grep -i curl

You can check your new PHP version by this php -v

This is the most suitable method for me. Because it doesn’t require enabling and diable the other related service for that desired PHP version. the codes above automatically handle those parts.

You can get more details about this topic from here.
To get to know more about Linux, you can check these articles too

Please follow and like us:

Related Posts

Leave a Reply

Share