Question

cURL is NOT installed in my PHP7 installation

I am running a script and I have this Fatal error: Call to undefined function curl_init() in /var/www/html/wp-content/plugins/accesspress-social-login-lite/twitter/twitteroauth.php on line 189

it appears curl is not enabled in my install, how may I go about it?

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

run the following command

apt-get install php7.0-curl

Hi,

How can I install curl in 7.1 version but doesn’t work and generate the error log:

Fatal error: Uncaught Error: Call to undefined function curl_init()

Please help me with the problem and working fine my code.

Hello,

If you’re using Nginx or Apache on Ubuntu 20 droplet:

Install PHP libraries for the server by running the following command:

sudo add-apt-repository ppa:ondrej/php

sudo apt update

sudo apt install curl

Check the version of curl installed by the command:

dpkg -l curl

You need to restart your webserver on which PHP is running: If you are using Apache server then use either of the following commands to restart the server:

sudo service apache2 restart

or

sudo /etc/init.d/apache2 restart

Similarly, if you are using Nginx server, then use either of the following commands:

sudo systemctl restart nginx

or

sudo /etc/init.d/nginx restart

Hope that this helps! Regards, Alex