Uncaught Error: Call to undefined function curl_init()

Method 1 

Enable cURL:

  1. If cURL is not enabled, you'll need to enable it. Depending on your hosting environment, you might have access to modify the PHP configuration file (php.ini) or use a control panel to enable the cURL extension.
  2. a. If you have access to the php.ini file, find and uncomment the line containing extension=curl, removing the semicolon (;) at the beginning of the line if present. After making this change, save the file and restart your web server.

  3. b. If you don't have direct access to the php.ini file, check if your hosting provider or server administrator offers a control panel (e.g., cPanel, Plesk, etc.) where you can enable the cURL extension.

 Method 2

In Ubuntu, you can install the cURL package using the package manager called apt. Here's the step-by-step guide to install cURL on Ubuntu:

Apply following steps

bash
sudo apt update
bash
sudo apt install curl
bash
curl --version

Method 3

bash
sudo apt install php-curl