This error message is indicating that the PHP function curl_init()
is not defined, which likely means that the cURL extension is not installed or enabled in your PHP configuration.
To resolve this issue, you need to install and enable the cURL extension for PHP. Here are the steps for installing the cURL extension on Ubuntu/Debian:
- Install the cURL library:
sudo apt-get update
sudo apt-get install curl libcurl3 libcurl3-dev php-curl
- Restart your web server:
sudo systemctl restart apache2
- Verify that the cURL extension is enabled by running the following command in the terminal:
php -m | grep curl
If the output contains curl
, then the extension is installed and enabled. If not, you need to enable the cURL extension in your php.ini
configuration file. The location of this file may vary, but you can use the following command to find it:
php -i | grep "Loaded Configuration File"
Once you have located the file, open it in a text editor and uncomment the line that starts with extension=curl
by removing the semi-colon at the beginning of the line. Save the file and restart your web server.
This should resolve the issue and allow you to use the curl_init()
function in your PHP code.