Forum Moderators: coopster

Message Too Old, No Replies

Installing or not using curl

         

lajkonik86

7:32 pm on Dec 18, 2004 (gmt 0)

10+ Year Member



Heeyz

A few weeks ago I posted here to ask how to get the html of a page which is dependent on cookies.
The only suggestion people came up with was curl.

Problem is my tech level aint high enough to install curl. There's no good tutorial which explains me how to install curl on windows. Even when I find a tutorial I don't understand what they are saying.

Is there any way to load the html of a site dependent on cookies in a variable (using php)?
Or do you know of any great premade packages out there?

Hope you can help me
Thanks in advance,
Thierry

lajkonik86

9:19 am on Dec 19, 2004 (gmt 0)

10+ Year Member



suppose i could always manually visit the site and save the html to a file:)

leifans

9:38 am on Dec 19, 2004 (gmt 0)

10+ Year Member



you needn't install it~
just modify the php.ini
get rid of the ";" before extension=php_curl.dll;

;extension=php_bz2.dll
;extension=php_cpdf.dll
extension=php_curl.dll
;extension=php_dba.dll

lajkonik86

12:36 pm on Dec 19, 2004 (gmt 0)

10+ Year Member



Thanks for responding

I did what you said but i probably don't have the files set up correctly. When visitng a php document it tells me.
"Unknown(): Unable to load dynamic library './php_curl.dll - The specified module could not be found

I got the curl folder in my c:/php/ what am i doing wrong?

leifans

3:09 pm on Dec 19, 2004 (gmt 0)

10+ Year Member



; Directory in which the loadable extensions (modules) reside.
extension_dir = "c:\php\ext"

make sure there's "php_curl.dll"
in c:\php\ext;
by the way my php version is 5.02

lajkonik86

3:56 pm on Dec 19, 2004 (gmt 0)

10+ Year Member



I'm working with 4.xx
When i checked the curl package i downloaded for that file it wasn't there.
Have i maybe got the wrong package?

I tried several just to be sure but didn't find that file anywere.

lajkonik86

4:26 pm on Dec 19, 2004 (gmt 0)

10+ Year Member



Got ssl installed. But that dll file you mentioned is nowhere to be found. I'm confused

lajkonik86

4:37 pm on Dec 19, 2004 (gmt 0)

10+ Year Member



Lets do a summary of my problem:

I got php 4.xx installed on windows
I downloaded this version of curl
[curl.haxx.se...]
I got the dll files for ssl in my system folder

When i take a look at the files in the downloaded curl.
There's a curl.exe which doens't do much of anything

when running php it tells me
Php_curl.dll not found

When i search my pc for this dll it's nowhere to be found.

What am i doing wrong?

lajkonik86

6:13 pm on Dec 19, 2004 (gmt 0)

10+ Year Member



Well apperently php_curl comes along with the binary non installer version of php. Great got the file now
Got it right here
extension_dir = "C:/PHP/ext/"

But hey still get unable to load dynamic library 'C:/PHP/ext/php_curl.dll" the specified module could not be found.

Truly have no clue why

claus

6:19 pm on Dec 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've got no clue apart from this:

>> extension_dir = "C:/PHP/ext/"

As you are on windows, try changing those slashes to the windows way

extension_dir = "C:\PHP\ext\"

- and perhaps remove the last slash, even.

...not sure if it helps, though

lajkonik86

7:02 pm on Dec 19, 2004 (gmt 0)

10+ Year Member



Tried all 4 possible options with that.
Didn't work though.

Could anyone maybe tell me how they would install php and curl on windows so i can check where i went wrong. (My php install is working perfectly though)

lajkonik86

9:55 pm on Dec 19, 2004 (gmt 0)

10+ Year Member



Anybody understanding this?

Installation

To use PHP's CURL support you must also compile PHP --with-curl[=DIR] where DIR is the location of the directory containing the lib and include directories. In the "include" directory there should be a folder named "curl" which should contain the easy.h and curl.h files. There should be a file named libcurl.a located in the "lib" directory. Beginning with PHP 4.3.0 you can configure PHP to use CURL for URL streams --with-curlwrappers.

leifans

3:10 pm on Dec 20, 2004 (gmt 0)

10+ Year Member



maybe the version of php you're working with
is lower than 4.30
I think you can try 5.0.3

-------------------------------
hard to communicate ......
for my bad English :(
perhaps I know why but just dont know how to express

mandlnet

8:51 am on Jan 2, 2005 (gmt 0)



Hi,
This is how I got CURL working on my Windows XP machine.

1. Copied libeay32.dll and ssleay32.dll to c:\windows\system32
2. Edited my PHP.ini file un-commenting extension=php_curl.dll
3. Checked what my extension directory was (extension_dir = "./")
4. Copied php_curl.dll from my c:\php\extensions directory to c:\php directory.

That was it. Tested it using $cp = curl_init(); and worked fine.

Hope this helps you.

Andrew McCarron

Code Sentinel

9:20 pm on Jan 2, 2005 (gmt 0)

10+ Year Member



mandlnet is right, you need to copy those two files to the windows/system32 folder to use CURL on windows.

I believe it is mentioned on the curl site somewhere.

vbbnn

4:26 pm on Jan 10, 2005 (gmt 0)

10+ Year Member



Hi,

I have used another method on my WinXP:

1. Add C:\php5 (my php503 root) to the path, Environment var
2. Uncomment extension=php_curl.dll
3. Set extension_dir = "c:/php5/ext"

I have ested it by using $cp = curl_init() and phpinfo(), and it worked fine.

In Phpinfo it shows following

CURL support ¦ enabled
CURL Information ¦ libcurl/7.11.2 OpenSSL/0.9.7c zlib/1.1.4

Regards

lajkonik86

12:51 pm on Jan 15, 2005 (gmt 0)

10+ Year Member



thanks you all i got it working

demnetia

2:53 am on Jan 16, 2005 (gmt 0)

10+ Year Member



You don't need cURL for this.
Just use fsockopen(), fwrite(), fgets(), fread()

1. Open a connection to the host using fsockopen()
2. Create the HTTP request headers. Example:

$headers = "GET /path/to/file.php?var=something HTTP/1.0\r\n";
$headers .= "Host: www.example.com:80\r\n";
$headers .= "Cookie: cookie_name=cookie_value; cookie2=value2 \r\n\r\n";

3. Write those headers to the socket created by fsockopen using fwrite or fputs
4. Read the response (headers + html) from the socket using file reading functions such as fread, fgets, etc
5. You're done.

It's also much faster the cURL.