I just upgraded to Ubuntu 18.04.1 LTS and went to check on my local apache2 installation by adding phpinfo() to an index file.

After update/reboot, I went to my local WordPress Admin area and attenpted to update a plugin and got the following error:

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

Here's what I did:

  1. I checked phpinfo() and no curl OR xdebug options are shown.
  2. I went to /etc/php/7.1/apache2/php.ini and uncommented the following line extension=php_curl.dll.
  3. I then restarted apache.
  4. Also, my phpinfo() shows Loaded Configuration File /etc/php/7.1/apache2/php.ini and THAT is the one I've been editing.

However, WordPress still reports the following: PHP Fatal error: Call to undefined function curl_init().

I'm thinking I MUST be editing the wrong ini file.

Any ideas? I'm dead in the water here. 😥

  • Do you uncomment to get curl running on Ubuntu I usually see this on window systems? – George Udosen Aug 5 '18 at 20:13
  • When I upgraded my server from 16 to 18, including ondrej's apache ppa, there was some conflict that ended up with libcurl3 getting uninstalled to resolve. So I had to reinstall curl and then it was OK. – Organic Marble Aug 5 '18 at 20:21

I have had the same problem as you, but with nextcloud. Sadly I didn't wrote down, what worked. I looked up in m histfile.

Try some of these and tell me what worked:

apt install php-curl
a2dismod php7.0
a2enmod php7.2

If it still doesnt work I could use this Information:

ls /etc/apache2/mods-enabled/php*


sleeper found a solution for php7.1 . You need to know your php version you want. Then you can install php7.1-curl (or your version of your php).

Source: unix.stackexchange.com

  • Here is the output of /etc/apache2/mods-enabled/php* - /etc/apache2/mods-enabled/php7.1.conf /etc/apache2/mods-enabled/php7.1.load – sleeper Aug 5 '18 at 20:24
  • Perhaps switching to php7.2 might help – Boba Fit Aug 5 '18 at 20:35
  • I did that and phpinfo IS showing curl and xdebug. Yay! BUT... now I cannot login to wordpress (locally) at all. White screen of death. Non-WP site appears to be fine. – sleeper Aug 5 '18 at 20:44
  • 1
    OK, so switching to php7.2 hosed up WordPress (for some reason) so I went back to 7.1 (which brought back local WP installations), then I ran the following: apt-get install php7.1-curl and that brought back curl! So I guess I'm good to go. In fairness, this question was posted on unix.stackexchange.com first, (because, in my panic, I simply forgot about this group for a moment) and Rui F Ribeiro provided a working solution. Ref: unix.stackexchange.com/a/460705/89702 ...so maybe this thread is likely a duplicate and can/should be deleted(?) – sleeper Aug 5 '18 at 21:01
  • I'm glad you you finally found someting. I dont know neither, if we should delete it or mark as duplicate. I will correct our solution, so everyone who is looking for a similar question can find faster your solution. If somebody want to delet it, he can. – Boba Fit Aug 5 '18 at 21:10

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.