I get following error when I try to use curl_init('some_url')
in a controller:
Call to undefined function App\Http\Controllers\curl_init()
but when I use php artisan tinker
and try to use curl_init('some_url')
it works fine and I get no error.
More Info:
when I type following command in terminal
php -i | grep curl
I get:
/etc/php/7.2/cli/conf.d/20-curl.ini,
curl
as answered in this link I tried reinstalling curl with:
sudo apt-get install php-curl
and I restarted apache with
sudo service apache2 restart
but I still get mentioned error when trying to use curl_init() in a controller. How can I fix this error?