-1

I want to call curl_init() on console Command laravel but I'm getting error "Call to undefined function curl_init()" ?

but when I call curl_init() from Controller laravel is working fine. Any Ideas?

backslashN
  • 2,795
  • 3
  • 15
  • 25
Komang
  • 1
  • Does this answer your question? [where can I find the php.ini for php-cli](https://stackoverflow.com/questions/3057110/where-can-i-find-the-php-ini-for-php-cli) – miken32 May 22 '22 at 01:12
  • Please provide enough code so others can better understand or reproduce the problem. – Community May 22 '22 at 14:22

2 Answers2

0

My guess is that you are using two different PHP installations in command line and on your local web server.

To verify that, check both versions: run php -v in command line to see what version is running in command line, and load a web page on your browser with this content for your webserver PHP version: <?php phpinfo();

If that is the case, activate "php_curl" extension on your command line installation.

-1

This error appears when curl extension is not being installed or activated. Run php -m command in your terminal or cmd to check whether curl is listed or not.

Sahand Moghadam
  • 447
  • 4
  • 9