Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enabling CURL with PHP 5.6 on Windows 8

Tags:

php

curl

windows

I have Apache 2.4.12 and php 5.6.9 on my Windows 8 computer and I'm trying to enable the curl extension for php however, I haven't had much success. After searching the internet for this issue it appears that other's have had the same trouble. Here are the suggestions I've found:

  • Uncomment ;extension=php_curl.dll in php.ini
  • Uncomment ;extension_dir = "ext" in php.ini
  • Download and replace the php_curl.dll file in the ext directory of php with one from this website
  • Add to the PATH environment variable where php is installed
  • Copy libeay32.dll and ssleay32.dll from where php is installed to C:\Windows\System32

I've tried every single suggestion with no success except the third item in the list because it doesn't have a .dll file for curl with php 5.6, in fact the highest version avaible is one for php 5.4. There has to be way to enable this extension without having to downgrade my php version to 5.4 and using a .dll file from that website. I've tried searching the internet for a .dll file like the one on the linked website for php 5.6 opposed to a version of php that's outdated but I've had no luck in finding one so I'd like help with this issue.

How can I enable curl for php 5.6 on my Windows 8 machine?

like image 466
CasualKyle Avatar asked May 30 '15 05:05

CasualKyle


2 Answers

Locate your php folder and follow these instructions:

  1. Move to Windows\system32 folder:

    libssh2.dll, php_curl.dll, ssleay32.dll, libeay32.dll

  2. Move to Apache24\bin folder

    libssh2.dll

  3. Uncomment extension=php_curl.dll

Note: Don't overwrite when prompted.

Source

like image 167
Max O. Avatar answered Sep 22 '22 04:09

Max O.


I give you an example of a set up that just worked perfectly for me :

  1. downloaded the VC11 x86 Thread Safe version of PHP,
  2. unzipped it within a directory C:\php,
  3. edited the php.ini-development, uncommenting 2 lines :
    • extension=php_curl.dll
    • extension_dir = "ext"
  4. saved this file under php.ini.

I just tested it via the CLI (windows CMD here) on a PHP a file (i.e. C:\php\php myFile.php) and cURL worked.

If you have Apache installed and prefer to test it in a browser, you obviously have to adapt this installation with your own files structure and to do not forget to restart Apache.

like image 28
Ivan Gabriele Avatar answered Sep 22 '22 04:09

Ivan Gabriele