How to get CURL to work with PHP on Windows? (WAMP)

强颜欢笑 提交于 2019-11-28 18:15:16

You don't have to reboot the computer, just restart the apache and the php module will read the new ini.
Did you change the correct php.ini? In case of doubt

<?php echo 'php.ini: ', get_cfg_var('cfg_file_path'); ?>

can tell you.

Is there something in the error.log of the apache that indicates that something went wrong while loading php and the php_curl.dll?

Did you start the apache as a win32 service? If you did try to start it as a console application. Error messages will show up on the console then. Or start it as a service and take a look at the error.log file and the windows event log (start, run, eventvwr.msc /s).

edit:
"The specified procedure could not be found"
You need a dll that is compatible with your php version and build. Exactly what did you install and where did you get it from?

Try this:

  1. Stop WAMP completely.
  2. Find your WAMP folder: C:\Path\To\WAMP\bin\Apache\ApacheVersion\bin\
  3. Edit that php.ini and uncomment extension=php_curl.dll
  4. Restart WAMP.

That should hopefully solve it.

*EDIT: Do the same thing @ C:\Path\To\WAMP\bin\php\PHPVersion\

Abhishek Rakshit

This is what worked for me

Answered by Soren from another SO thread - CURL for WAMP

"There seems to be a bug somewhere. If you are experiencing this on Win 7 64 bit then try installing apache addon version 2.2.9 and php addon version 5.3.1 and switching to those in WAMP and then activating the CURL extension. That worked for me."

This fixed it for me:

Go to here:

http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/

Download 'php_curl-5.3.13-VC9-x64.zip'

Stop WAMP Server from Running

Extract the file 'php_curl.dll'.

On your local machine, browse to (or where your WAMP installation is found) c:\wamp\bin\php\php5.3.13\ext

Rename php_curl.dll to php_curl.dll.old (or whatever you choose) and then copy the new file into the above directory.

Restart WAMP Server

All should be working ok now.

I had the same problem with php-5.5.26-Win32-VC11-x64 (on Windows) and I tried everything listed here with no luck. Finally I got it working by adding PHP installation directory to windows Path.

With PHP 5.6.9 on Windows Server Core 2012 x64 cURL was not working, not showing up in phpinfo despite uncommenting php_curl.dll extension in my php.ini and restarting the Apache 2.4 service. Added the php path and the php\ext path to my $evn:path. No joy.

Fix: I didn’t need to download any other php_curl.dll file and couldn’t find one for PHP 5.6 anyway. What finally worked was to copy these three files into the Apache24\bin folder then restart Apache:

libeay32.dll

libssh2.dll

ssleay32.dll Copying these to System or System32 was not needed.

If the problem persists after you uncomment the module from both php.ini files (that people are already talking about and which are located on apache folder and php folder) and even after you check that you got the php_curl.dll ** at

C:\WAMP\bin\php\php5.3.13\ext

YOU SHOULD TRY TO REPLACE THE ORIGINAL DLL THAT COMES WITH WAMPSERVER with one from this website:

http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/

My problem was there! Hope it helps.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!