0

I want to install CURL extension in my WAMP server. I tried so many solutions including this

But it's not work for me. Can any one help me.

Community
  • 1
  • 1
Lanka
  • 29
  • 2
  • 11

1 Answers1

1

To turn curl extension on in WAMPServer all you need to do is using the wampmanager icon menus do :-

wampmanager -> PHP -> Extensions -> php_curl

If that is ticked then the extension is enabled, if not then click it and repeat the process to check it is now ticked.

If this fails, edit php.ini (careful as there are more than one of these )

wampmanager -> PHP -> php.ini

And check this line does not have a ; semi colon in front of it

extension=php_curl.dll

Now if you are using WAMPServer 2.4 or earlier version you also may need to copy these 2 dll's from the php folder to the Apache folder.

copy \wamp\bin\php\{phpversion}\libeay32.dll \wamp\bin\apache\{apacheversion}\bin
copy \wamp\bin\php\{phpversion}\ssleay32.dll \wamp\bin\apache\{apacheversion}\bin

If you are using WAMPServer 2.5 it should have already created SYMLINKS for these 2 files in the \wamp\bin\apache{apacheversion}\bin folder, but if not then do this to make it redo the symlink processing

wampmanager -> Apache -> {apacheversion}

And just click the Apache version number and it will rebuild the symlinks.

It's probably also a good idea to activate the php_openssl extension as I belive cUrl can use this in certain situations. Do this just like you did to activate the php_curl extension.

If you want to use cURL from the command line, then you also need to manually edit the php.ini file that the CLI uses.

Edit \wamp\bin\php{phpversion}\php.ini and uncomment php_curl and php_openssl

Added additional simple curl test

To test if PHP has cURL extension loaded run this simple script

<?php
// Get curl version array
$version = curl_version();
echo '<pre>' . print_r($version,true) . '</pre>';
?>

If it is loaded then you will get a result something like this but with different values as you are probably running a different version

Array
(
    [version_number] => 466432
    [age] => 3
    [features] => 3005
    [ssl_version_number] => 0
    [version] => 7.30.0
    [host] => i386-pc-win32
    [ssl_version] => OpenSSL/0.9.8y
    [libz_version] => 1.2.7
    [protocols] => Array
        (
            [0] => dict
            [1] => file
            [2] => ftp
            [3] => ftps
            [4] => gopher
            [5] => http
            [6] => https
            [7] => imap
            [8] => imaps
            [9] => ldap
            [10] => pop3
            [11] => pop3s
            [12] => rtsp
            [13] => scp
            [14] => sftp
            [15] => smtp
            [16] => smtps
            [17] => telnet
            [18] => tftp
        )

)

If it is not loaded you will just see an error on the page, or in the error log if you are not showing errors to the browser.

ADDITIONAL INFO

If you are using 64bit PHP V5.3x or V5.4x, there were some releases that came with a bad version of php_curl.dll. You can get a fixed version from http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/

Download the cURL version that corresponds to your PHP version under "Fixed curl extensions:".

You will need the Thread Safe version to run on WAMPServer i.e. the one without -nts- in the name.

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
  • I tried , but it gives this error.. Fatal error: Uncaught exception 'Exception' with message 'Facebook needs the CURL PHP extension.' in C:\wamp\www\facebook-php-sdk-master\src\base_facebook.php on line 19 .. – Lanka Nov 11 '14 at 10:41
  • Are you running WampServer 32bit or 64bit – RiggsFolly Nov 11 '14 at 14:33
  • When I run that test script it gives me an error. Call to undefined function curl_version() – Lanka Nov 12 '14 at 03:22
  • See answer for Additional Info. I think you may have one of the versions of PHP that contained a bad version of php_curl – RiggsFolly Nov 12 '14 at 03:29