How to get curl working on win 10 , wamp php 7.2?
Asked Answered
R

9

8

I tried everything I could find like instructions here How to get CURL to work with PHP on Windows? (WAMP)

to copy dll files from php7.2.0 folder to apache2.4.18\ bin folder

my setup

win 10 64
wamp 3.1.1 
php, 5.6.28, 7.0.4, 7.2
apache 2.4.18 

curl works on any other php version but not on 7.2

cheeked extension_dir path and it points to right dir

extension_dir ="T:/wamp64/bin/php/php7.2.0/ext/" 

loaded php 7.2 extensions

extension=bz2
extension=curl
;extension=dba
extension=com_dotnet
;extension=enchant
extension=fileinfo
;extension=ftp
extension=gd2
extension=gettext
extension=gmp
extension=intl
extension=imap
;extension=interbase
extension=ldap
extension=mbstring
extension=exif      ; Must be after mbstring as it depends on it
extension=mysqli
;extension=odbc
extension=openssl
;extension=pdo_firebird
extension=pdo_mysql
;extension=pdo_oci
;extension=oci8_12c  ; Use with Oracle Database 12c Instant Client
;extension=pdo_odbc
;extension=pdo_pgsql
extension=pdo_sqlite
;extension=pgsql
;extension=phpdbg_webhelper
;extension=shmop

now I see that in 7.0.4 there was php_ prefix and dll suffix

extension=php_curl.dll

but this is in the 7.2 info

; When the extension library to load is not located in the default extension
; directory, You may specify an absolute path to the library file:
;
;   extension=/path/to/extension/mysqli.so
;
; Note : The syntax used in previous PHP versions ('extension=<ext>.so' and
; 'extension='php_<ext>.dll') is supported for legacy reasons and may be
; deprecated in a future PHP major version. So, when it is possible, please
; move to the new ('extension=<ext>) syntax.
;
; Notes for Windows environments :
;
; - ODBC support is built in, so no dll is needed for it.
; - Many DLL files are located in the extensions/ (PHP 4) or ext/ (PHP 5+)
; extension folders as well as the separate PECL DLL download (PHP 5+).
; Be sure to appropriately set the extension_dir directive.

someone else had the same issue but there was no solution http://forum.wampserver.com/read.php?2,149346,149609#REPLY

Revest answered 22/12, 2017 at 15:58 Comment(3)
What errors are you getting?Petrarch
undefined function curl_init() if that is what you mean ,Revest
@Revest yes that's what he means. also this seem to indicate that you're running with display_startup_errors disabled in php.ini (or that it's not in the .ini at all - and the default value if its not in the php.ini is disabled!), please set display_startup_errors=1 in php.ini, restart everything and try again.Devaluate
R
24

Solution that worked for me

Install Apache 2.4.29,

for some reason 2.4.18 was not loading php 7.2 curl

Revest answered 22/12, 2017 at 16:7 Comment(4)
I already had Apache 2.4.29 and curl was not working for php 7.2 I updated to Apache 2.4.39 and curl is now working. I wonder if it is just the process of installing a new Apache version that gets things workingMercaptide
God I was looking for a solution for days, installing a new version of Apache finally worked. Apache 2.4.39 worked for me as well. ThanksTandie
PHP 8.0.7, update Apache to version 2.4.48 fixed the issue.Sochor
Updating Apache worked for me too! I downloaded the Windows version from Apachehaus and overwrote the apache folder files (except for the /conf directory).Bigg
B
4

Hope this will help someone. I spent 4 hours finding a solution for this problem and nothing I found was effective. So what I did was (Windows 10 x64 + Apache 2.4.29):

  1. I downloaded php 7.2 for windows from the PECL and uncommented and changed the ;extension=curl to extension=php_curl.dll
  2. Copied the libssh2.dll from the php folder to the Apache24/bin folder.

And it worked!!!

Of course changed the Windows PATH variable pointing to the old php version folder to the new folder. I read some comments that it's not a good idea of copy and paste the file but this was the only option which worked for me.

Buckingham answered 10/2, 2018 at 13:22 Comment(1)
For PHP 7.2 and 7.3 I did not need to change the the extension=curl. But I also needed to copy libcrypto-1_1.dll and libssl-1_1.dll. This works the same way for php 7.3 (even with the dlls from php 7.2 :).Fullblown
J
3

I wanted to use cURL with php 7.2 and apache 2.4.39 so here are the steps that worked for me for WAMPSERVER 64 BITS (X64) 3.17 on windows 10:

  1. left click on the wamp icon in the tray > php > php extensions > check the 'curl' option
  2. copy the file C:\wamp64\bin\php\php7.2.18\libssh2.dll to C:\wamp64\bin\apache\apache2.4.39\bin\libssh2.dll
  3. left click on the wamp icon in the tray > restart all services
Janinajanine answered 4/7, 2019 at 10:39 Comment(1)
This worked for me while installing opencart. Thank you so much!Candiecandied
C
1

WINDOWS

Prior to PHP 7.2, curl and openssl required the following files in your root PHP folder (where NN is either 32 or 64 depending on your install):

  • libeayNN.dll
  • ssleayNN.dll

Those files are missing in 7.2. Now the following files are required for PHP 7.2 (part of 7.2 package):

  • libcrypto-1_1-xNN.dll
  • libssl-1_1-xNN.dll
Cosmos answered 3/5, 2018 at 18:15 Comment(0)
F
1

In my case I had apache 2.4.21 and curl did not work with php 7.2 or 7.3.

By Updating the apache to 2.4.41 It is working now.

So updating apache is a good solution, if others did not work.

Flavoring answered 11/12, 2019 at 21:6 Comment(0)
A
1

SOLVED

I am using wampserver 3.2.0 on windows 7. for some reasons Apache 2.4.33 and 2.4.43 were not loading curl. I installed Apache 2.4.39 into wampserver and enabled the curl in php extentions.

now it's working.

Albata answered 21/7, 2020 at 18:19 Comment(0)
A
0

The solution that worked for me:

Apache httpd version: Apache/2.4.43 (Win64)

for some reason 2.4.33 was not loading php 7.2 curl

Alemanni answered 16/5, 2020 at 14:45 Comment(0)
B
0

If you are using wampserver , just go to

https://sourceforge.net/projects/wampserver/files/WampServer%203/WampServer%203.0.0/Addons/Apache/

Select the latest version and download and double click to install the addon automatically

GO to wamp and select the newly installed apache version.

It worked for me

Barringer answered 18/6, 2020 at 8:34 Comment(0)
G
0

I am using Apache 2.4.20 and php 7.2.23 under windows 10 x64 and have some trouble with how to activate curl. I tried any tutorial and I find some solution for this case. Perhaps, my solution it works for all of you about how to activate curl library. I change httpd.conf on Apache and add manualy syntax for load file of php 7.2.23 on my windows. This syntax on httpd.conf in my windows:

LoadFile "C:/WebServer/php-7.2.23/libssh2.dll"

LoadFile "C:/WebServer/php-7.2.23/libcrypto-1_1-x64.dll"

LoadFile "C:/WebServer/php-7.2.23/libssl-1_1-x64.dll"

LoadFile "C:/WebServer/php-7.2.23/ext/php_curl.dll"

Then restart apache web server. Finally, i check via browser solve. "CURL is Installed on this server" with php script to check curl library is active or not.

Good luck.

Gay answered 31/8, 2022 at 4:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.