Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Curl - Does not work on Windows CLI

Tags:

php

curl

Curl would not work on windows Command Prompt but it working fine on the browser (localhost)

Error:

C:\wamp\www\site>C:\wamp\bin\php\php5.3.0\php.exe -f index.php

PHP Fatal error:  Call to undefined function curl_init() in C:\wamp\www\site\index.php on line 111

Fatal error: Call to undefined function curl_init() in C:\wamp\www\site\index.php on line 111

Yes PHP Curl is enabled, like I said it work fine on the browser.

like image 371
I'll-Be-Back Avatar asked Jul 01 '11 09:07

I'll-Be-Back


People also ask

Why is curl not working in cmd?

We might have come across errors like “curl: command not found” while working in the terminal. This type of error comes due to only one reason: the relevant package is not installed. Curl is a very popular data transfer command-line utility used for downloading and uploading data from or to the server.

Does curl command work on Windows?

Invoke curl.exe from a command window (in Windows, click Start > Run and then enter "cmd" in the Run dialog box). You can enter curl --help to see a list of cURL commands.

How do I hit curl command in Windows?

Install cURL To check whether it is installed on your system or not, type curl in your terminal window and press enter. If it isn't installed, it will show a “command not found” error. Use the commands below to install it on your system.

How do I run a curl command in terminal?

Open a command prompt by clicking the Start button and typing cmd. Type curl -V .


1 Answers

Run php -r "echo php_ini_loaded_file();" in the command line to see which ini file is being loaded.

Then remove the ; before extension=php_curl.dll around line 656

Restart apache

For this to work, make sure php is set as global variable, if not got to D:\wamp\bin\php\php5.2.5 (path can change on ur computer) from the command line & run the code

like image 168
charles Avatar answered Oct 19 '22 15:10

charles