curl install

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
fabby
Forum Commoner
Posts: 62
Joined: Tue Feb 15, 2005 1:06 am
Location: Romania
Contact:

curl install

Post 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!
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post 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
fabby
Forum Commoner
Posts: 62
Joined: Tue Feb 15, 2005 1:06 am
Location: Romania
Contact:

Post 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?
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post 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.
fabby
Forum Commoner
Posts: 62
Joined: Tue Feb 15, 2005 1:06 am
Location: Romania
Contact:

Post 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?
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post 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.
fabby
Forum Commoner
Posts: 62
Joined: Tue Feb 15, 2005 1:06 am
Location: Romania
Contact:

Post 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?
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post 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.
fabby
Forum Commoner
Posts: 62
Joined: Tue Feb 15, 2005 1:06 am
Location: Romania
Contact:

Post by fabby »

yes, i have modified the corect php.ini...i don't understand what happends!
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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.
fabby
Forum Commoner
Posts: 62
Joined: Tue Feb 15, 2005 1:06 am
Location: Romania
Contact:

Post 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!
Post Reply