Page 1 of 1

curl install

Posted: Wed May 30, 2007 2:37 pm
by fabby
i have readed this tutorial: http://www.tonyspencer.com/2003/10/22/c ... n-windows/ to learn how to install curl, but with no success.
Can you help me, pls?
I have windows xp, with php5 and apache2
Thank you!

Posted: Wed May 30, 2007 2:40 pm
by superdezign
You're in luck. I JUST installed it myself. It was easier than I thought. Here's what you do:

1) Edit php.ini. Add this line (or uncomment it if it exists.. it didn't in mine, but I'm PHP4) with the rest of the extensions:

extension=php_curl.dll

2) Copy libeay32.dll and ssleay32.dll from your PHP DLLs directory into C:\WINDOWS\SYSTEM (or where ever your windows\system folder is).

3) Restart your server and viola. :-p

Posted: Wed May 30, 2007 2:45 pm
by fabby
nope, it doesn't work! :(
But, in an tutorial, it says that i have to install some from http://curl.haxx.se/download.html ? o it isn't necessary?

Posted: Wed May 30, 2007 2:47 pm
by superdezign
On Linux. Not on Windows with PHP. PHP comes with the php_curl.dll, libeay32.dll, and ssleay32.dll, and the Windows system folder is where it looks for the second two DLLs.

Try to run curl_init() without the DLLs in the system folder, but having the php_curl.dll extension enabled. You should get a popup box with an error message about missing DLL files. If not, then your extension probably isn't properly enabled.

Posted: Wed May 30, 2007 3:13 pm
by fabby
in php.ini i have:

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

and when i delete php_cur.php from system and system32, and restart apache, i dont't recieve any message!
Can you tell me why?

Posted: Wed May 30, 2007 3:26 pm
by superdezign
I've absolutely no idea what php_cur.php is, or why you've deleted it.

What I'm asking you to do is to delete libeay32.dll and ssleay32.dll (the files I first asked you to copy over) from your Windows\System folder. Then, try to run this in a php file:

Code: Select all

// See if cURL works
curl_init();
An error message should popup when you run that script.

Otherwise, you're not editing the right php.ini file.

Posted: Wed May 30, 2007 3:41 pm
by fabby
i recieve this message:
"Fatal error: Call to undefined function curl_init() in E:\web design\websites\curl\index.php on line 2"
what to do now?

Posted: Wed May 30, 2007 3:46 pm
by superdezign
And no popup box? That means that you haven't enable it yet.

Run phpinfo() and tell me what you get. It will tell you the location of the correct php.ini file for you to edit.

Posted: Thu May 31, 2007 2:13 am
by fabby
yes, i have modified the corect php.ini...i don't understand what happends!

Posted: Thu May 31, 2007 2:29 am
by volka
please run

Code: Select all

<?php
$ini = get_cfg_var('cfg_file_path');
echo 'version: ', phpversion(), "<br />\n";
echo 'sapi: ', php_sapi_name(), "<br />\n";
echo 'ini: ', $ini, "<br />\n";
foreach(file($ini) as $l ) {
	if ( false!==strpos($l, 'curl') || false!==strpos($l, 'extension_dir') ) {
		echo $l;
	}
}
echo 'end';
and post the output.

Posted: Sun Jun 03, 2007 4:48 pm
by fabby
look th result:

version: 5.1.6
sapi: apache2handler
ini: E:\web design\programs\php\php.ini
extension_dir = "E:/web design/programs/php/ext/" ; extension_dir directive above. ; Be sure to appropriately set the extension_dir directive. extension=php_curl.dll end

sorry because i didn't response earliest!