I have curl installed and running on php for Apache2. On command line however it does not work:
$ php test.php
PHP Fatal error: Uncaught Error: Call to undefined function curlhttp()
checking for curl:
$ php -i | grep curl
/etc/php/7.0/cli/conf.d/20-curl.ini,
curl
having a deeper look:
cat /etc/php/7.0/cli/conf.d/20-curl.ini
; configuration for php curl module
; priority=20
extension=curl.so
where is the library anyway?
$ locate curl.so
/usr/lib/php/20151012/curl.so
/usr/lib/x86_64-linux-gnu/libcurl.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.4.0
which php version?
$ php -v
PHP 7.0.33-0ubuntu0.16.04.15 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.33-0ubuntu0.16.04.15, Copyright (c) 1999-2017, by Zend Technologies
with Xdebug v2.4.0, Copyright (c) 2002-2016, by Derick Rethans
Let's check SO for a solution: How to install php-curl in Ubuntu 16.04
trying to reinstall:
sudo apt install php7.0-curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
php7.0-curl is already the newest version (7.0.33-0ubuntu0.16.04.15).
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
$ sudo apt install curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
curl is already the newest version (7.47.0-1ubuntu2.14).
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
I don't see the problem. What might be the cause and how can this be fixed?