I'm using PHP 5.6. I've already installed curl using the following commands:
sudo apt-get install php-curl
sudo apt-get install php5-curl
But even still, I keep getting the error:
Call to undefined function curl_init()
However, when I locate curl.ini
, it shows this:
/etc/php5/apache2/conf.d/20-curl.ini
/etc/php5/cgi/conf.d/20-curl.ini
/etc/php5/cli/conf.d/20-curl.ini
/etc/php5/fpm/conf.d/20-curl.ini
/etc/php5/mods-available/curl.ini
/usr/share/php5/curl/curl.ini
/var/lib/ucf/cache/:etc:php5:mods-available:curl.ini
And when I locate curl.so
, it shows this:
/usr/lib/php5/20131226/curl.so
/usr/lib/x86_64-linux-gnu/libcurl.so.3
/usr/lib/x86_64-linux-gnu/libcurl.so.4
/usr/lib/x86_64-linux-gnu/libcurl.so.4.3.0
So I changed the line in /etc/php5/mods-available/curl.ini
from:
extension=curl.so
To:
extension=/usr/lib/php5/20131226/curl.so
But I'm still getting the error.
What's wrong?
php5enmod curl
followed by a restart of your webserver