PHP Warning: PHP Startup: Unable to load dynamic library php_curl.dll impossibile find
Asked Answered
T

7

20

I have Windows 10 with WAMP server (Apache 2.4.9, PHP 5.5.29 VC11 x64, e MySQL). All works fine, but now I will use curl extension.

I go into C:\wamp\bin\php\php5.5.29\phpForApache.ini (from webserver configuration) and remove the comment from extension=php_curl.dll

reload apache server and in error_log I have

[22-Sep-2015 13:13:30 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.5.29/ext/php_curl.dll' - Impossibile trovare il modulo specificato.in Unknown on line 0

The DLL is on the correct folder and the other DLLs work fine.

1° try: I added in system var PATH: C:/wamp/bin/php/php5.5.29/ext/;c:/wamp/bin/php/php5.5.29/

2° try: I have re-dowload the file php-5.5.29-Win32-VC11-x64.zip and replaced the php_curl.dll

But I have always the same result: index.php

Fatal error: Call to undefined function curl_exec()

phperror_log:

[22-Sep-2015 13:13:30 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.5.29/ext/php_curl.dll' - Impossibile trovare il modulo specificato.in Unknown on line 0

Trainload answered 22/9, 2015 at 13:25 Comment(8)
in Unknown on line 0 this is odd. Can you see curl information on phpinfo(); ?Bills
only "cURL Sterling Hughes " in modules authorTrainload
if i comment an uncomment php_imap.dll i see the load e not load module , but the curl don't work neverTrainload
myabe there is something in window 10Trainload
sometimes, it happens just because of incompatible curl version, you can test it by downloading 32/64 bit curl libsVeroniqueverras
Do you still have that problem? It solved for me when I copied libeay32.dll and ssleay32.dll from another curl installation into Apache's bin folder.Pebbly
also me i had solved when i copied these filesTrainload
next time dont copy your error message on your native language. By accident, I know this is Italian, and "cant find the module"Mal
F
22

These steps worked for me:

  1. Add the main php folder onto the Path Env variable in Windows (so libeay32.dll and ssleay32.dll are path-accessible ... some people copy these to Windows/System32 to make them path-accessible but that isn't really elegant way to solve issue)
  2. Add the Apache bin folder onto the Path Env variable in Windows

  3. Copy the file libssh2.dll from the php folder to apache's bin folder (Apache seems to need this for php's curl to work in Windows)

Fencing answered 4/11, 2016 at 14:41 Comment(7)
Only the 3rd method worked for me on PHP 5.6.31 with Apache 2.4.28.Sparerib
The 3rd method worked for me also, on the same configuration than @ilhan.Womanhater
"Add the main php folder onto the Path Env variable" juste that, perfect !Paling
Number 3 does the trick. 1 and 2 are not needed, as it's clear in the original post that Apache is already looking in the right place for the dll. The problem is it can't load it.Indent
Only the 3rd method worked for me on apache 2.4.48 and php 8.1.0. Thx a lot !!!Telex
Regarding "Add the Apache bin folder onto the Path Env variable in Windows": It worked for me only by adding to System variables. It didn't work for "User variables for USERNAME", so not to be confused :)Sideways
Thank you so much. The 3rd was the solution. I had a different version of the lib on Apache' bin dir. I changed it for the correct version on phpGena
C
17

PHP Startup: Unable to load dynamic library 'curl' ... Uncommenting 2 lines in the php.ini file solves this

  1. Open php.ini
  2. Remove semicolon to uncomment ;extension_dir = "ext" If your php is in C under the folder "php" for example, your extension_dir = "ext" should be put as extension_dir = "C:\php\ext"
  3. Remove semicolon to uncomment ;extension=curl
  4. Save php.ini
Cotto answered 30/9, 2020 at 13:52 Comment(2)
This worked for a PHP 8.x installationHistoricity
worked for me on php8.2 but don't forget to make service apache2 restartTranscendentalistic
N
7

What worked for me I copied :

  • libssh2.dll,
  • libcrypto-1_1-x64.dll,
  • libssl-1_1-x64.dll,
  • ssleay32.dll,
  • libeay32.dll

to Apache bin folder. Probably not all of those are needed.

Next

  1. In php.ini, make sure the extension curl is loaded. This will be extension=php_curl.dll for php < 7 and extension=curl for php > 7

  2. Restart Apache Service

Noncooperation answered 25/4, 2020 at 16:49 Comment(1)
For me it was sufficient to copy libeay32.dll and ssleay32.dllGreenwald
R
2

Make sure that in php.ini, extension_dir = points to the correct path if it's uncommented.

Reclaim answered 29/10, 2020 at 17:22 Comment(0)
B
1

Another possibility is an incompatibility between the version of apache and php, at least if you're using wampserver and/or missing VC++ executables. I was using php 7.4.11 and apache 2.4.27. Upgrading to apache 2.4.46d and installing missing executables solved the problem. That version of apaache also requires updating wampserver to 3.2.5. Make sure ALL the windows VC++ executable are installed. There is a small tool to check this. The updates and tools are found at https://wampserver.aviatechno.net/

@see http://forum.wampserver.com/read.php?2,151396

I performed the wampserver/apache update and installed some missing VC++ files all at once, so I can't be certain which thing actually fixed the problem loading curl.

Balbo answered 4/4, 2021 at 11:4 Comment(1)
After spending several hours looking for a solution, upgrading apache solved my curl problem !Pervasive
K
-1

i was facing the same error with wamp on windows the problem solved when i deleted another app using php (and making conflict) and reinstall wamp

Kramer answered 8/4, 2020 at 20:50 Comment(0)
W
-1

Add to Apache httpd.conf:

LoadFile "C:/Php56/libssh2.dll"
LoadFile "C:/Php56/libeay32.dll"
LoadFile "C:/Php56/ssleay32.dll"
Westwardly answered 18/3, 2023 at 21:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.