Configure Php Curl with Apache

I know its easy to setup curl with php in Linux, but it was a bit harder for me for windows. Its been weired when you see that you searched through the Google and did exactly what you found from search result but still your Curl is not working from PHP. Your getting the error like below.

Fatal error: Call to undefined function curl_init()

Most of the people i found from blog are suggested me not to use Installer for apache. They suggested me to download the separates binaries for Apache and Curl, and then install them. I tried, and according to them I kept the "libeay32.dll" and "ssleay32.dll" into the apache directory, inside php directory, and inside the windows directory. But nothing worked.

Finally I gave a last try and It worked. From one forum, an expert suggested me to download the latest version of EasyPHP(EasyPHP 2.0b1, an open source application http://www.softpedia.com/get/Authoring-tools/Setup-creators/EasyPHP.shtml). Below is how you have to do to setup curl with Easyphp.

** Run the exe for Easyphp from program files. You'll find an icon at system tray. right click the icon then click Configuration, then click PHP Extension. See the image below.

easyphp curl php apache
** Now you'll find few extension for your apache/php. Just select the php_curl extension and click apply button and restart your apache.

easyphp curl php apache
Write the below php code and browse from your browser to check whether it working or not. By the way, you have to keep the php script inside the "www" folder.

<?php
   $ch = curl_init();
   print "WOW no error!!! Curl installed successfully..";
?>

I think you shouldn't face any problem from now to use the Curl with your php script. Its a single click installation process. I have posted another topic related to setting up cgi for Perl/Python script at http://icfun.blogspot.com/2008/04/easiest-way-to-configure-perlpython.html

Comments

Anonymous said…
Hiya,

Looks simple enough.
But i Can't seem to find the Curl extension download?

Might be looking for the wrong thing.

Is it possible to get a link for where you got it?
Or was it included in your EasyPHP install?

Mine did not include any extras like cURL.

Thanks very much!
Demon said…
It is comes with easyphp installation. Just check how I mentioned what to do. ~Thanks
BobbyLongshot said…
Hmm.. my EasyPHP didnt have any extensions in that menu. I only get a red error warning. Any syggestions?
Demon said…
I was using easyphp 2.01, may be you are using older or newer version. That may be different.
Demon said…
for easyphp 3.0, open the php.ini file from "conf_files" folder.

At the top of the file, write

path = "C:\PROGRA~1\EASYPH~1.0"

Then search for extension_dir inside the file using ctrl+f, and use this one,

extension_dir = "C:\PROGRA~1\EASYPH~1.0\php\ext\"

And finally look for the curl, and remove semicolon(;) from the first of the line to enable it. So it will look like as below.

extension=php_curl.dll

Finally copy the php.ini file at your C:\windows\ folder.

Now it should work for your curl codes.

Thanks
Demon said…
Note: Copying the ini file at windows directory means, you'll use it from command prompt. Otherwise it won't require to copying, for example from running from your browser.
Unknown said…
thanks mate for the tutorial.
I've long suffered from problems related to curl extension. by following your tutorial here, I've resolved the problems.

regards.
I have EasyPhp 5.2.1 installed but there is no option to enable curl extension ...
ultimatum said…
I just tried your guide and it didn't work for me. The extensions window had no extensions to offer. I had Denwer previously installed and may be that created a conflict with EasyPHP, I guess I just have to keep looking or re-install everything.
hi i have easyphp 5.3 and i have the cul turned on in the extention. but still it shows error message that its not turned on. please help me. thanks
i have easyphp 5.3 and it has the extention curl turned on. but still says not turned on . please help me if u can. thanks