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.

1

13 Answers 13

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Fixed versions for 64bit Windows versions are at the bottom section of your link "Fixed curl extensions:"
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?
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.

5 Comments

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 :)
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.
Dont forget to copy libssh2.dll also!
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 : For win10x64, I copied libeay32.dll, libssl32.dll and libssh2.dll in both c:\windows\system32 and c:\windows\syswow64 and it fixed everything...
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!!!!

3 Comments

got exactly the same problem and your solution DID help. Thanks!
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.
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?
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.

4 Comments

No. You don't have to enable it in Apache.
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.
+1 because if you don't uncomment the line in php.ini of apache you get an error with undefined function curl.
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.
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

3 Comments

Thanks a lot! Environment variables in Windows Path: C:\wamp\bin\php\php7.0.7
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?
Try the absolute path for extension_dir option.
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.

Comments

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.

Comments

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.

1 Comment

I edited the one in Apache folder. I did a echo of the variable to be sure I edited the good one.
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

1 Comment

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.
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

Comments

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

Comments

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

Comments

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.