Execute Curl script from command prompt?

Shockey

2[H]4U
Joined
Nov 24, 2008
Messages
2,205
Hello. I recently discovered how to run php from the command line and i tried executing a php curl script that connect to a website. It spit out errors and quits executing soon as it goes to the start of the curl execution.

I tried a simple "hello world script" and it worked and echoed off in the command prompt window just fine. Also these script work fine when access with a web browser just the curl part doesn't work in command prompt.

So i wanting to know how to execute php curl scripts from command prompt?

Looked all over google and see this question asked with no answers really. Anyone here know how to get curl to work on command prompt??

BTW running windows.


Thanks in advance!!!
 

ameoba

Supreme [H]ardness
Joined
Jan 9, 2001
Messages
6,413
What do you mean "it doesn't work"? Does it just die silently or do you get some sort of error?

Are your command-line and web versions of PHP compiled with the same add-in libraries?
 

Shockey

2[H]4U
Joined
Nov 24, 2008
Messages
2,205
What do you mean "it doesn't work"? Does it just die silently or do you get some sort of error?

Are your command-line and web versions of PHP compiled with the same add-in libraries?

It gives an error PHP FATAL ERROR "Call to undefined function curl_init

I installed apache, php, mysql with WAMP. Made no changes to it since i installed it and just tried executing this in the command prompt

So i believe they are the same libraries.
 

Whatsisname

[H]F Junkie
Joined
Nov 15, 2000
Messages
10,202
are you using libcurl or are you doing a system call to exec curl.exe

it seems you don't have libcurl installed.
 

Shockey

2[H]4U
Joined
Nov 24, 2008
Messages
2,205
are you using libcurl or are you doing a system call to exec curl.exe

it seems you don't have libcurl installed.


didnt install anything outside of what wamp installed. Which i guessing isn't libcurl. curl.exe is non existant as i tried finding it to use on the command line EX (curl.exe C:\path\to\script.php)

so no call to any sort of curl. Is that the solution?

i been doing this in directory where (php is installed ;) )php.exe is: php C:\path\to\script.php
 
Top