I have Ubuntu 12.04 with PHP 5.6.11 and running Apache/2.4.12. I've installed CURL by running
sudo apt-get install php5-curl
sudo service apache2 restart
curl -V
curl 7.22.0 (i686-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap pop3 pop3s rtmp rtsp smtp smtps telnet tftp
Features: GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP
which curl
/usr/bin/curl
phpinfo()
Configuration File (php.ini) Path /etc/php5/apache2
Loaded Configuration File /etc/php5/apache2/php.ini
Scan this dir for additional .ini files /etc/php5/apache2/conf.d
Additional .ini files parsed /etc/php5/apache2/conf.d/05-opcache.ini, /etc/php5/apache2/conf.d/10-pdo.ini, /etc/php5/apache2/conf.d/20-json.ini, /etc/php5/apache2/conf.d/20-mysql.ini, /etc/php5/apache2/conf.d/20-mysqli.ini, /etc/php5/apache2/conf.d/20-pdo_mysql.ini, /etc/php5/apache2/conf.d/20-readline.ini
First, check that the extension is installed (with relevant example output):
$ sudo find / -name curl.so\*
/usr/lib64/php/7.0/modules/curl.so
Then, check that the extension is enabled (again with relevant output):
$ grep -Ri curl /etc/php*
/etc/php.d/20-curl.ini:extension=curl.so
If the first command doesn't produce any output, then the module wasn't installed. You'll need to diagnose why your system package manager didn't install the package. For Ubuntu, you might need to run sudo apt-get update
.
If the first command worked, but the second didn't, you'll need to enable the extension, then restart Apache afterwards:
echo 'extension=curl.so' | sudo tee /etc/php5/apache2/conf.d/99-curl.ini