'Call to undefined function curl_init() on console Command laravel
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?
Solution 1:[1]
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.
Solution 2:[2]
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | bryanjesuistonpere |
| Solution 2 | Sahand Moghadam |
