Windows 7 64位和Apache下的PHP和CURL

Windows 7 64位和Apache下的PHP和CURL

问题描述:

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. 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.

我正试图在我的盒子上使用curl而没有任何成功。 p>

我的配置: strong> p>


操作系统:win 7 64位, p>

PHP :5.3.1, p>

Apache:2.2.14 p>


我能够使用mysql扩展,所以 我的php.ini的配置似乎很好。 但是我在使用curl的Apache日志中得到错误: p>

PHP警告:PHP启动:无法加载动态库'C:/php-5.3.1/ext/php_curl.dll' - 找不到指定的模块。 在第0行的未知中 p>

文件就在那里,它正在加载php_mysql.dll而没有任何问题。 p>

我尝试了一切: 将dll文件放在apache \ bin,windows \ system32中,将php EXT的路径放在PATH环境变量中。 放一些lib(libeay.dll和sssomething.dll 在Windows 32中 p>

嗯,我认为这可能与我的Windows 64位或PHP版本有关。也许。 我不知道了:( p>

任何想法? p>

更新 strong> 我没有使用Wamp因为我 想知道我对我的系统做了什么,最终选择了我想要的apache,php和MySql版本。 p>

我的解决方案 strong> p> \ n

我在PATH environement变量中添加了PHP的路径并且它有效。我将尝试找出所需的DLL。 p>

更新:它看起来好像 喜欢它是libeay32.dll和sslleay32.dll必须在PATH环境变量。我添加到Apache的bin子目录,它工作。 p> div>

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

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.

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.

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.

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.

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

I tried all above steps and still having same problem. I did copied the libeay32.dll and sselay.dll in to C:\windows\system32 and restart but still does not work.

Yet, when I copied libeay32.dll and sselay.dll to C:\windows, it WORKS!!!!

What I did for this problem with PHP cURL in Windows 7 64-bit / Windows 8 64-bit:

  1. Stop WampServer.
  2. Open php.ini in C:\wamp\bin\php\(your PHP version) and remove the semicolon from ;extension=php_curl.dll.
  3. Start WAMP and test.

If it is still not working:

I downloaded php_curl-(your PHP version)-VC9-x64.zip from this link, and replaced the default php_curl.dll in C:\wamp\bin\php\php-virsion\ext with the new one.

This solved my problem.

For others having the same problem, if the selected solution does not work, you should know that the php_curl.dll in a certain package of WAMP server was the wrong file, I had the same problem, I found the correct php_curl.dll file in /wamp/bin/php/php[youversion/ext/ and replaced it and it worked. See this article: http://forum.wampserver.com/read.php?2,85716

  1. Goto WAMP's bin folder and open php folder. open php.ini and uncomment extension=php_curl.dll

  2. Goto WAMP's bin folder and open Apache\bin. Open php.ini and umcomment extension=php_curl.dll

Restart WAMP Source:: Thats all!!! Problem fixed

I had same problem for my Apache24 on Windows 7 with PHP 5.6.5 This is what I did and fixed the problem. Move to Windows\system32 folder: libssh2.dll, php_curl.dll, ssleay32.dll, libeay32.dll

Move to Apache24\bin folder libssh2.dll

Uncomment extension=php_curl.dll

To enable cURL using PHP7, insert the C:\php to the PATH: enter image description here

After that, go to C:\php open the php.ini file and uncomment the line extension extension=php_curl.dll by deleting the semicolon at the beginning of the line: enter image description here

Your are ready to go: enter image description here

Only had to copy libssh2.dll to the apache folder for cURL support to be enabled.

Using:

  • Apache 2.4
  • Php 7.0.11 - Win32-VC14-x86
  • Windows 7 Professional x64