Enabling CURL with PHP 5.6 on Windows 8

I have Apache 2.4.12 and php 5.6.9 on my Windows 8 machine and I am trying to enable the curl extension for php, but I have not had much success. After searching the Internet for this issue, it looks like others had the same problems. Here are the suggestions I 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 php directory using one of this website
  • Add to the PATH environment variable where php is installed
  • Copy the libeay32.dll and ssleay32.dll files from where php is installed in C: \ Windows \ System32

I tried every sentence without success, except for the third element in the list, because it does not have a .dll file for curl with php 5.6, in fact the highest version of avaible is one for php 5.4. There should be a way to enable this extension without having to downgrade my php version to 5.4 and use the DLL file from this website. I tried searching the Internet for a .dll file, such as the one on the linked website for php 5.6, against the version of outdated PHP, but I was not lucky to find it, so I would like to help with this problem.

How to enable curl for php 5.6 on my windows 8 machine?

+5
source share
5 answers

Find your php folder and follow these instructions:

  • Navigate to the Windows \ system32 folder:

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

  • Move to Apache24 \ bin folder

    libssh2.dll

  • Uncomment extension = php_curl.dll

Note. Do not overwrite when prompted.

A source

+9
source

Starting the apache service with a specific user other than the local one solved the problem for me. You can easily test this by stopping the apache service and manually starting <apache dir>\bin\httpd.exe .

+2
source

I will give you an example setup that just worked fine for me:

  • downloaded VC11 x86 Thread Safe PHP version ,
  • unzip it to the directory C:\php ,
  • edited php.ini-development , uncommenting 2 lines:
    • extension=php_curl.dll
    • extension_dir = "ext"
  • saved this file under php.ini .

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

If you installed Apache and chose to test it in a browser, you will obviously have to adapt this installation to your own file structure and remember to restart Apache.

+1
source

I fixed this problem by adding the system variables C:\php and C:\php\ext to PATH .

  • Press window + pause to open the system properties page.
  • Click "Advanced System Settings"
  • Select environment variables

You will see the PATH variable in the System Variables field below. Add the path to this PHP variable. Now the system will be able to download extensions.

0
source

In addition to uncommenting the line

 ;extension_dir = "ext" 

Try also setting it to the absolute path to the PHP installation folder and then restarting apache.

eg:.

 extension_dir = "C:\PHP 5.6.19\ext" 
0
source

All Articles