"Call to undefined function lib\\oauth\\curl_init()" when using facebook oauth2 #2021-0-18_22-41-6

OS info

  • Operating System : Windows 10.0.19042
  • Wappler Version : 3.7.1

Problem description

Getting the error when I open tlogin oauth2 to facebook in a browser

Steps to reproduce

  1. make a fb oauth2 login and open it in a browser

Everything seems ok in the server side authorization

Error message

file “/var/www/html/ykb/dmxConnectLib/lib/oauth/Oauth2.php”
line 336
message “Call to undefined function lib\oauth\curl_init()”
trace #0 /var/www/html/ykb/dmxConnectLib/lib/oauth/Oauth2.php(256): lib\oauth\Oauth2->httpPost()\n#1 /var/www/html/ykb/dmxConnectLib/lib/oauth/Oauth2.php(230): lib\oauth\Oauth2->grant()\n#2 /var/www/html/ykb/dmxConnectLib/modules/oauth.php(24): lib\oauth\Oauth2->authorize()\n#3 /var/www/html/ykb/dmxConnectLib/lib/App.php(193): modules\oauth->authorize()\n#4 /var/www/html/ykb/dmxConnectLib/lib/App.php(157): lib\App->execSteps()\n#5 /var/www/html/ykb/dmxConnectLib/lib/App.php(127): lib\App->execSteps()\n#6 /var/www/html/ykb/dmxConnectLib/lib/App.php(94): lib\App->exec()\n#7 /var/www/html/ykb/dmxConnect/api/sikkerhet/fblogin.php(8): lib\App->define()\n#8 {main}”

It looks like curl is not installed on your server.

Curl is installed on both the server and the windows machine I am using wappler on.

But can this be a problem with the fact hat I installed nodejs on the server and that this app is using php?

The problem was that php7.4 was updated thru wrong repository for ubuntu 20.04 and that resultet in missing dependencies of the php curl and some other php packages.

Problem fixed after reinstaling php on the server.

I just had the same problem, running php 7.4 on Ubuntu 20… It took a lot of fiddling around and googling, so here is a summary of what I did on the server:

sudo apt update
sudo apt install curl
sudo apt install php-curl
sudo systemctl restart apache2

I’m not sure if I needed to install curl before php-curl, but anyway, it fixed things!