I've recently updated my Ubuntu from 16.04 to 18.04 and then from 18.04 to 20.04. Now two plugins on my Wordpress site give me these errors:

1- OneSignal Push: cURL is not installed on this server. cURL is required to send notifications. Please make sure cURL is installed on your server before continuing.

2- Composer detected issues in your platform: Your Composer dependencies require the following PHP extensions to be installed: curl

I’ve tried every related solution on the internet so far but could not solve this problem yet. I ran sudo apt-get install curl, but nothing has changed. I also got this: curl is already the newest version (7.68.0-1ubuntu2.2).

Output of apt-cache policy php7.4-curl

php7.4-curl: Installed: (none) Candidate: 7.4.3-4ubuntu2.4 Version table: 7.4.12-3+ubuntu16.04.1+deb.sury.org+1 -1 100 /var/lib/dpkg/status 7.4.3-4ubuntu2.4 500 500 focal-updates/main amd64 Packages 500 focal-security/main amd64 Packages 7.4.3-4ubuntu1 500 500 focal/main amd64 Packages 500 focal/main amd64 Packages 
8

1 Answer

The package curl contains the command line interface, basically the command curl. But WordPress (including its plugins) are developed in PHP, and PHP can't just use the command line version of cURL. PHP needs the corresponding extension for that.

In Ubuntu, several PHP extensions are packaged as their own packages, like php-mysql or php-imagick. In the case of cURL, that extension package would be php-curl. That's probably what you're missing.

As a side note: php-curl doesn't itself contain the PHP extension. This is provided by a package for the respective PHP version that php-curl depends on. So, if you install php-curl for example on Ubuntu 20.04, it will also install php7.4-curl, because Ubuntu 20.04 comes with PHP 7.4.

11

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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