Enable cURL on PHP7 windows10 64-bit Apache 2.4

I am using Windows10 64 bit Apache 2.4.25 (Win64) PHP 7.1.0-Win32-VC14-x64

when I try to call the curl_init () function, I get the error message "Calling the undefined function curl_init ()" tried to follow

  • copy ssleay32.dll and libeay32.dll and php7ts.dll to apache / bin folder
  • set the path for inclusion above the files "C: / PHP;"

Any help is greatly appreciated.

+5
source share
5 answers

Following are the steps to get PHP to enable cURL:

  • Download PHP (these steps have been tested since 7.1)
  • Add PHP folder to PATH environment variable
  • Update the php.ini file with an absolute path for the extension directory and uncomment the extensions php_curl.dll and php_openssl.dll
  • Update httpd.conf (Apache configuration file) to load the php7apache2_4.dll module into the PHP folder and install PHPIniDir in the PHP directory
  • Copy libeay32.dll libssh2.dll and ssleay32.dll to apache / bin (replace existing)
  • Restart Apache.
+17
source

I fixed it:

1) Edit php.ini file Include (uncomment) php_curl.dll and php_openssl.dll extensions

2) go to c: / php7 /

Copy the libssh2.dll file to the c: / apache24 / bin folder.

3) test by: curl_test.php

<?php // Script to test if the CURL extension is installed on this server // Define function to test function _is_curl_installed() { if (in_array ('curl', get_loaded_extensions())) { return true; } else { return false; } } // Ouput text to user based on test if (_is_curl_installed()) { echo "cURL is <span style=\"color:blue\">installed</span> on this server"; } else { echo "cURL is NOT <span style=\"color:red\">installed</span> on this server"; } ?> 
+7
source

in PHP 7.2.2 Windows 10 Apache 2.4 After some time searching for answers why the cURL library does not load, I just copied libssh2.dll from \ php to \ Apache24 \ bin and everything started working fine

+4
source

Here is what worked for me ...

Env info

  • WAMP server version 3.1.9
  • Apache 2.4.39
  • PHP 7.2.18

Step 1

From PHP downloads, I got VC15 x64 Thread Safe (2019-May-01 10:48:48) https://windows.php.net/download#php-7.2

Step 2

Extract the zip file and /ext/php_curl.dll to /ext/php_curl.dll C:\wamp64\bin\php\php7.2.18\ext (overwriting)

Step 3

Restarted all services

MADE

0
source

It will save my life (from https://www.php.net/manual/en/curl.installation.php )

Upgrading to php 7.1.6 on Apache 2.4 32-bit version of Windows 7 x64

this curl implementation works:

  1. C: / (path to php folder) /php.ini enable extension = php_curl.dll

libeay32.dll, ssleay32.dll, libssh2.dll are found directly in the php7 folder

  1. add this to Apache / conf / httpd.conf

    load curl and open ssl library LoadFile "C: / (path to php folder) /libeay32.dll" LoadFile "C: / (path to php folder) /ssleay32.dll"

LoadFile "C: / (path to php folder) /libssh2.dll"

If you do not find some of these DLLs, try downloading the non-TS version of fo php and copying them from this folder.

0
source

Source: https://habr.com/ru/post/899121/


All Articles