Enable cURL on PHP7 windows10 64 bit Apache 2.4

Sonic picture Sonic · Jan 24, 2017 · Viewed 26.3k times · Source

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

when i try calling curl_init() function, i get an error saying "Call to undefined function curl_init()" tried following

  • copying ssleay32.dll & libeay32.dll & php7ts.dll to apache/bin folder
  • setting path properly to include above files "C:/PHP;"

Any help much appreciated.

Answer

bnp887 picture bnp887 · Mar 19, 2017

Here are the steps from obtaining PHP to enabling cURL:

  1. Download PHP (these steps tested with 7.1)
  2. Add PHP folder to PATH environment variable
  3. Update php.ini file with absolute path for extension directory and uncomment php_curl.dll and php_openssl.dll extensions
  4. Update httpd.conf (Apache config file) to load php7apache2_4.dll module in PHP folder and set PHPIniDir to PHP directory
  5. Copy libeay32.dll libssh2.dll and ssleay32.dll into apache/bin (replace existing)
  6. Restart Apache.