Windows 安装上的 PHP / cURL:“找不到指定的模块。”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12348/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
PHP / cURL on Windows install: "The specified module could not be found."
提问by Derek Kurth
I'm running PHP 5.2.3 on Windows 2000 Server with IIS 5. I'm trying to get cURL working, so in my php.inifile, I have this line:
我在带有 IIS 5 的 Windows 2000 Server 上运行 PHP 5.2.3。我试图让 cURL 工作,所以在我的php.ini文件中,我有这一行:
extension_dir ="F:\PHP\ext"
extension_dir ="F:\PHP\ext"
And later, I have:
后来,我有:
extension=php_curl.dll
扩展名=php_curl.dll
The file F:\PHP\ext\php_curl.dllexists, but when I try to run any PHP script, I get this in the error log:
文件F:\PHP\ext\php_curl.dll存在,但是当我尝试运行任何 PHP 脚本时,我在错误日志中得到了这个:
PHP Warning: PHP Startup: Unable to load dynamic library 'F:\PHP\ext \php_curl.dll' - The specified module could not be found. in Unknown on line 0
PHP 警告:PHP 启动:无法加载动态库 'F:\PHP\ext\php_curl.dll' - 找不到指定的模块。在未知的第 0 行
回答by Derek Kurth
Problem solved!
问题解决了!
Although the error message said The specified module could not be found, this is a little misleading -- it's not that it couldn't find php_curl.dll, but rather it couldn't find a module that php_curl.dllrequired. The 2 DLLs it requires are libeay32.dlland SSLeay32.dll.
虽然错误消息说找不到指定的模块,但这有点误导——不是找不到php_curl.dll,而是找不到php_curl.dll所需的模块。它需要的 2 个 DLL 是libeay32.dll和SSLeay32.dll。
So, you have to put those 2 DLLs somewhere in your PATH (e.g., C:\Windows\system32). That's all there is to it.
因此,您必须将这 2 个 DLL 放在 PATH 中的某个位置(例如,C:\Windows\system32)。这里的所有都是它的。
However, even that did not work for me initially. So I downloaded the Windows zip of the latest version of PHP, which includes all the necessary DLLs. I didn't reinstall PHP, I just copied all of the DLLs in the "ext" folder to my PHP extensions folder (as specified in the extension_dirvariable in php.ini), and I copied the versions of libeay32.dlland SSLeay32.dllfrom the PHP download into my System32 directory.
然而,即使这对我来说最初也不起作用。所以我下载了最新版本的 PHP 的 Windows zip,其中包括所有必需的 DLL。我没有重新安装 PHP,我只是将“ext”文件夹中的所有 DLL 复制到我的 PHP 扩展文件夹(如 中的extension_dir变量中所指定php.ini),然后将 PHP 下载中的libeay32.dll和版本复制SSLeay32.dll到我的 System32 目录中。
I also did an iisreset, but I don't know if that was necessary.
我也做了一个 iisreset,但我不知道是否有必要。
回答by elQuique
libeay32.dlland ssleay32.dllhave to be path-accessible for php_curl.dllto work correctly.
libeay32.dll并且ssleay32.dll必须是路径可访问的php_curl.dll才能正常工作。
In Control Panel-> Search-> Advanced System Settingsand use the button Environment Variables.
在Control Panel-> Search-> Advanced System Settings并使用按钮Environment Variables。
Under System Variablesfind Pathadd the c:/phpfolder (or whatever path) and restart Apache.
在System Variables 下找到Path添加c:/php文件夹(或任何路径)并重新启动 Apache。
回答by Patrik Svensson
A tip is to use the WAMP-installer. Everything just works. It's not IIS though - so if it is important - you should ignore my advice. ;)
一个提示是使用WAMP-installer。一切正常。虽然它不是 IIS - 所以如果它很重要 - 你应该忽略我的建议。;)
EDIT: I saw that you found the solution so I voted it up. +1
编辑:我看到你找到了解决方案,所以我投票了。+1
回答by Blerta
I keep having same problem although i did the suggestion above and many others suggested on the internet i get
我一直有同样的问题,虽然我做了上面的建议,我得到了互联网上的许多其他建议
Sorry, but this plugin requires libcurl to be activated on your server.
抱歉,此插件需要在您的服务器上激活 libcurl。
When i try to activate my plugin.
当我尝试激活我的插件时。
Edited: I was using php 5.3.13 had win64 windows 7 and none of the soln was working for me.
编辑:我使用的是 php 5.3.13 有 win64 windows 7 并且没有一个 soln 对我有用。
1.I had tried to copy the libeay32.dll SSLeay32.dll in windows\system32 folder did not work 2. Edited and uncommented both php.ini files did not work 3. Activated php_curl in php extensions did not work 4. Copied and replaced several times the www.anindya.comversion of php_curl.dll but seems i was downloading the wrong version of this. The version that worked for me was in Fixed curl extensions section the second file php_curl-5.3.13-VC9-x64
1.我曾尝试复制 windows\system32 文件夹中的 libeay32.dll SSLeay32.dll 不起作用 2. 编辑和取消注释两个 php.ini 文件都不起作用 3. 在 php 扩展中激活的 php_curl 不起作用 4. 复制并替换几次www.anindya.comphp_curl.dll的版本,但看来我还是下载的这个版本错误。对我有用的版本在第二个文件 php_curl-5.3.13-VC9-x64 的固定卷曲扩展部分
Hope this will help anyone else
希望这会帮助其他人
回答by profnotime
Faced this problem when I upgraded the php in UwAmp to 7.2.*. The only solution that worked for me was to download the latest version of apache at the time (Apache/2.4.37 (Win32)) and replace the one that came with UwAmp. That also involved editing the sample httpd.conf to produce an httpd_uwamp.conf file. UwAmp needs this template to then generate the actual httpd.conf when it starts up. All other suggestions above didn't resolve it for me unfortunately. Also note that as of OpenSSL 1.1, libeay32.dll and ssleay32.dll are no longer required (see http://php.net/manual/en/curl.installation.php)
当我将 UwAmp 中的 php 升级到 7.2.* 时遇到了这个问题。唯一对我有用的解决方案是下载当时最新版本的 apache(Apache/2.4.37 (Win32))并替换 UwAmp 附带的那个。这还涉及编辑示例 httpd.conf 以生成 httpd_uwamp.conf 文件。UwAmp 需要这个模板,然后在它启动时生成实际的 httpd.conf。不幸的是,上面的所有其他建议都没有为我解决。另请注意,从 OpenSSL 1.1 开始,不再需要 libeay32.dll 和 ssleay32.dll(请参阅http://php.net/manual/en/curl.installation.php)

