views:

1416

answers:

6

I'm trying to use curl with PHP on my box without any success.

My Config :


OS : win 7 64 bits,

PHP : 5.3.1,

Apache : 2.2.14


I was able to use the mysql extension, so the configuration of my php.ini seems fine. But I get and error in Apache log with curl :

PHP Warning: PHP Startup: Unable to load dynamic library 'C:/php-5.3.1/ext/php_curl.dll' - The specified module could not be found.\r\n in Unknown on line 0

The file is right there, and it's loading php_mysql.dll without any problem.

I tried everything : to put the dll file in apache\bin, windows\system32, put the path of the php EXT in the PATH environment variable. to put some lib (libeay.dll and sssomething.dll) in windows 32

Well, I think this might have something to do with my Windows being 64 bits or with the version of PHP.. maybe. I don't know anymore :(

Any idea?

Update I'm not using Wamp because I like to know what I do to my system, and ultimately choose the version that I want of apache, php and MySql.

My Solution

I added the path of PHP in my PATH environement variable and it worked. I'll try to find out what was the DLL needed.

Update : Well it looks like it was libeay32.dll and sslleay32.dll had to be in the PATH environment variable. I added to the bin subdirectory of Apache and it worked.

A: 

It's been a while since i've been on windows, but I think you have to also make sure that curl has a check mark next to it under "plugins". Also, just searched google and found this:

Curl can indeed be enabled under WAMP running on a Windows Environment.

The steps are as follows :

1) Close WAMP (if running) 2) Navigate to WAMP\bin\php(your version of php)\ 3) edit php.ini 4) Search for curl, uncomment extension=php_curl.dll 5) Navigate to WAMP\bin\Apache(your version of apache)\bin\ 6) edit php.ini 7) Search for curl, uncomment extension=php_curl.dll 8) Save both 9) Restart WAMP Source: http://www.dibugs.com/curl-enabling-wamp

It appears you have to enable it in apache, as well as the php.ini. Try just right clicking on the wamp icon next time, hovering to extensions, then clicking on the desired extensions.

Codygman
No. You don't have to enable it in Apache.
George Edison
I guess I wasn't clear in my original post, but I'm not using wamp (the application). But I'm sure I edited the good php.ini, because I made and echo of the variable. but thanks for the help.
No problem. Let us know how you work this out.
George Edison
A: 

This may be a longshot, but which php.ini did you edit? Because with WAMP, the one Apache uses is in the bin directory of Apache.

George Edison
I edited the one in Apache folder. I did a echo of the variable to be sure I edited the good one.
+1  A: 

You could have used the Wampserver from http://www.wampserver.com/en/ From the menu it provides you can easily enable curl it takes care of the rest.

Since there are packages like XAMPP http://www.apachefriends.org/en/xampp-windows.html, and WAMP already available on the net you can use them to set up the WAMP stack instead of building it from the scratch. Thease packages offer easy menus for enabling and disabling php extensions.

thinktejas
+1 for mentioning XAMPP
George Edison
+1  A: 

AFAIR, you need libeay32.dll and libssl32.dll files on PATH for Curl to work properly. And probably 64 bit for your x64 system.

Sergei
Well, I added the path of PHP (not the EXT subfolder) to the PATH environment variable and it worked.. what... the... hell. I thought I did that before, anyway, it was because of you, thanks :)
A: 

Man, it's doing my head in. I've done the same right off the bat (experience with php...), added the path of PHP and PHP/ext, but no-go. It just would not init.

I've installed all 64-bit on a win7 x64 (so mysql/php/apache are all 64-bit versions) but I'm at a loss.

World of advice; install the 32-bit versions if you can help it. 64 bit is still the 'mystic future', sadly, regardless of x64 processors being around for years.

Steve
A: 

Please copy the libeay32.dll and sselay.dll in to the C:\windows and C:\windows\system32 and restart on your webserver and see the correct php.ini file is loaded

Someone