17

I'm trying to use curl with PHP on my box without any success.

My Config :


OS : win 7 64 bits,

PHP : 5.3.1,

Apache : 2.2.14


I was able to use the mysql extension, so the configuration of my php.ini seems fine. But I get and error in Apache log with curl :

PHP Warning: PHP Startup: Unable to load dynamic library 'C:/php-5.3.1/ext/php_curl.dll' - The specified module could not be found.\r\n in Unknown on line 0

The file is right there, and it's loading php_mysql.dll without any problem.

I tried everything : to put the dll file in apache\bin, windows\system32, put the path of the php EXT in the PATH environment variable. to put some lib (libeay.dll and sssomething.dll) in windows 32

Well, I think this might have something to do with my Windows being 64 bits or with the version of PHP.. maybe. I don't know anymore :(

Any idea?

Update I'm not using Wamp because I like to know what I do to my system, and ultimately choose the version that I want of apache, php and MySql.

My Solution

I added the path of PHP in my PATH environement variable and it worked. I'll try to find out what was the DLL needed.

Update : Well it looks like it was libeay32.dll and sslleay32.dll had to be in the PATH environment variable. I added to the bin subdirectory of Apache and it worked.

mrmuggles
  • 2,081
  • 4
  • 25
  • 44
  • See also https://stackoverflow.com/questions/16424117/php-unable-to-load-php-curl-dll-extension – Jake Sep 02 '17 at 01:26

13 Answers13

18

What I did for this problem with PHP cURL in Windows 7 64-bit / Windows 8 64-bit:

  1. Stop WampServer.
  2. Open php.ini in C:\wamp\bin\php\(your PHP version) and remove the semicolon from ;extension=php_curl.dll.
  3. Start WAMP and test.

If it is still not working:

I downloaded php_curl-(your PHP version)-VC9-x64.zip from this link, and replaced the default php_curl.dll in C:\wamp\bin\php\php-virsion\ext with the new one.

This solved my problem.

uınbɐɥs
  • 7,236
  • 5
  • 26
  • 42
Erfan Safarpoor
  • 5,109
  • 4
  • 23
  • 27
  • Fixed versions for 64bit Windows versions are at the bottom section of your link "Fixed curl extensions:" – Shantha Kumara Dec 12 '13 at 11:02
  • not solved for win10x64 php7 apache 2.4.23, PHP Warning: PHP Startup: Unable to load dynamic library 'ext\\php_curl.dll' - The specified procedure could not be found.\r\n in Unknown on line 0 any idea? – Wasim A. Dec 12 '16 at 18:29
8

AFAIR, you need libeay32.dll and libssl32.dll files on PATH for Curl to work properly. And probably 64 bit for your x64 system.

Sergei
  • 2,747
  • 1
  • 17
  • 16
  • Well, I added the path of PHP (not the EXT subfolder) to the PATH environment variable and it worked.. what... the... hell. I thought I did that before, anyway, it was because of you, thanks :) – mrmuggles Jan 21 '10 at 02:07
  • 1
    You dont actually need to put them on the path. All you need to do is copy libeay32.dll and libssl32.dll from the PHP folder to the Apache\bin folder. – RiggsFolly Nov 12 '14 at 11:52
  • Dont forget to copy libssh2.dll also! – ontananza Jul 14 '15 at 23:08
  • not solved for win10x64 php7 apache 2.4.23, PHP Warning: PHP Startup: Unable to load dynamic library 'ext\\php_curl.dll' - The specified procedure could not be found.\r\n in Unknown on line 0 any idea? – Wasim A. Dec 12 '16 at 18:03
  • @Wasim : For win10x64, I copied libeay32.dll, libssl32.dll and libssh2.dll in both c:\windows\system32 and c:\windows\syswow64 and it fixed everything... – 00seb Oct 13 '17 at 09:21
7

I tried all above steps and still having same problem. I did copied the libeay32.dll and sselay.dll in to C:\windows\system32 and restart but still does not work.

Yet, when I copied libeay32.dll and sselay.dll to C:\windows, it WORKS!!!!

Tim Smith
  • 71
  • 1
  • 2
  • got exactly the same problem and your solution DID help. Thanks! – Misha Narinsky Dec 08 '11 at 23:16
  • 1
    You dont actually need to put them in either of these directories. All you need to do is copy libeay32.dll and libssl32.dll from the PHP folder to the Apache\bin folder. – RiggsFolly Nov 12 '14 at 11:54
  • not solved for win10x64 php7 apache 2.4.23, PHP Warning: PHP Startup: Unable to load dynamic library 'ext\\php_curl.dll' - The specified procedure could not be found.\r\n in Unknown on line 0 any idea? – Wasim A. Dec 12 '16 at 18:29
4

It's been a while since i've been on windows, but I think you have to also make sure that curl has a check mark next to it under "plugins". Also, just searched google and found this:

Curl can indeed be enabled under WAMP running on a Windows Environment.

The steps are as follows :

1) Close WAMP (if running) 2) Navigate to WAMP\bin\php(your version of php)\ 3) edit php.ini 4) Search for curl, uncomment extension=php_curl.dll 5) Navigate to WAMP\bin\Apache(your version of apache)\bin\ 6) edit php.ini 7) Search for curl, uncomment extension=php_curl.dll 8) Save both 9) Restart WAMP Source: http://www.dibugs.com/curl-enabling-wamp

It appears you have to enable it in apache, as well as the php.ini. Try just right clicking on the wamp icon next time, hovering to extensions, then clicking on the desired extensions.

codygman
  • 832
  • 1
  • 13
  • 30
  • 1
    No. You don't have to enable it in Apache. – Nathan Osman Jan 20 '10 at 05:16
  • I guess I wasn't clear in my original post, but I'm not using wamp (the application). But I'm sure I edited the good php.ini, because I made and echo of the variable. but thanks for the help. – mrmuggles Jan 20 '10 at 05:43
  • 1
    +1 because if you don't uncomment the line in php.ini of apache you get an error with undefined function curl. – brittongr Feb 17 '12 at 23:34
  • had uncommented the line in the php folder, but the key is uncommenting it in both places. can confirm this worked for me to enable curl on local wamp server. – helgatheviking May 04 '12 at 16:16
4

To enable cURL using PHP7, insert the C:\php to the PATH: enter image description here

After that, go to C:\php open the php.ini file and uncomment the line extension extension=php_curl.dll by deleting the semicolon at the beginning of the line: enter image description here

Your are ready to go: enter image description here

Andre Oliveira
  • 197
  • 2
  • 10
  • Thanks a lot! Environment variables in Windows Path: C:\wamp\bin\php\php7.0.7 – Laguna Web Design Jun 03 '16 at 17:38
  • not solved for win10x64 php7 apache 2.4.23, PHP Warning: PHP Startup: Unable to load dynamic library 'ext\\php_curl.dll' - The specified procedure could not be found.\r\n in Unknown on line 0 any idea? – Wasim A. Dec 12 '16 at 18:04
  • Try the absolute path for extension_dir option. – Tobia Apr 13 '17 at 15:12
3

Man, it's doing my head in. I've done the same right off the bat (experience with php...), added the path of PHP and PHP/ext, but no-go. It just would not init.

I've installed all 64-bit on a win7 x64 (so mysql/php/apache are all 64-bit versions) but I'm at a loss.

World of advice; install the 32-bit versions if you can help it. 64 bit is still the 'mystic future', sadly, regardless of x64 processors being around for years.

Steve
  • 31
  • 1
2

You could have used the Wampserver from http://www.wampserver.com/en/ From the menu it provides you can easily enable curl it takes care of the rest.

Since there are packages like XAMPP http://www.apachefriends.org/en/xampp-windows.html, and WAMP already available on the net you can use them to set up the WAMP stack instead of building it from the scratch. Thease packages offer easy menus for enabling and disabling php extensions.

tejzpr
  • 945
  • 8
  • 19
1

This may be a longshot, but which php.ini did you edit? Because with WAMP, the one Apache uses is in the bin directory of Apache.

Nathan Osman
  • 71,149
  • 71
  • 256
  • 361
1

Please copy the libeay32.dll and sselay.dll in to the C:\windows and C:\windows\system32 and restart on your webserver and see the correct php.ini file is loaded

Someone
  • 10,405
  • 23
  • 67
  • 100
  • You dont actually need to put them in either of these directories. All you need to do is copy libeay32.dll and libssl32.dll from the PHP folder to the Apache\bin folder. – RiggsFolly Nov 12 '14 at 11:55
0

For others having the same problem, if the selected solution does not work, you should know that the php_curl.dll in a certain package of WAMP server was the wrong file, I had the same problem, I found the correct php_curl.dll file in /wamp/bin/php/php[youversion/ext/ and replaced it and it worked. See this article: http://forum.wampserver.com/read.php?2,85716

Neo
  • 11,078
  • 2
  • 68
  • 79
0
  1. Goto WAMP's bin folder and open php folder. open php.ini and uncomment extension=php_curl.dll

  2. Goto WAMP's bin folder and open Apache\bin. Open php.ini and umcomment extension=php_curl.dll

Restart WAMP Source:: Thats all!!! Problem fixed

0

I had same problem for my Apache24 on Windows 7 with PHP 5.6.5 This is what I did and fixed the problem. Move to Windows\system32 folder: libssh2.dll, php_curl.dll, ssleay32.dll, libeay32.dll

Move to Apache24\bin folder libssh2.dll

Uncomment extension=php_curl.dll

Polorumpus
  • 392
  • 4
  • 9
0

Only had to copy libssh2.dll to the apache folder for cURL support to be enabled.

Using:

  • Apache 2.4
  • Php 7.0.11 - Win32-VC14-x86
  • Windows 7 Professional x64
4n0nym0u5
  • 25
  • 3