简体   繁体   English

PHP 警告:PHP 启动:无法加载动态库 php_curl.dll 不可能找到

[英]PHP Warning: PHP Startup: Unable to load dynamic library php_curl.dll impossibile find

I have Windows 10 with WAMP server (Apache 2.4.9, PHP 5.5.29 VC11 x64, e MySQL).我有带 WAMP 服务器的 Windows 10(Apache 2.4.9、PHP 5.5.29 VC11 x64、e MySQL)。 All works fine, but now I will use curl extension.一切正常,但现在我将使用 curl 扩展。

I go into C:\\wamp\\bin\\php\\php5.5.29\\phpForApache.ini (from webserver configuration) and remove the comment from extension=php_curl.dll我进入C:\\wamp\\bin\\php\\php5.5.29\\phpForApache.ini (来自网络服务器配置)并从extension=php_curl.dll删除注释

reload apache server and in error_log I have重新加载 apache 服务器并在error_log我有

[22-Sep-2015 13:13:30 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.5.29/ext/php_curl.dll' - Impossibile trovare il modulo specificato.in Unknown on line 0 [2015 年 9 月 22 日 13:13:30 UTC] PHP 警告: PHP 启动:无法加载动态库 'c:/wamp/bin/php/php5.5.29/ext/php_curl.dll' - Impossibile trovare il modulospecificato .in 未知第0

The DLL is on the correct folder and the other DLLs work fine. DLL 位于正确的文件夹中,其他 DLL 工作正常。

1° try : I added in system var PATH: C:/wamp/bin/php/php5.5.29/ext/;c:/wamp/bin/php/php5.5.29/ 1°尝试:我在系统C:/wamp/bin/php/php5.5.29/ext/;c:/wamp/bin/php/php5.5.29/路径中添加: C:/wamp/bin/php/php5.5.29/ext/;c:/wamp/bin/php/php5.5.29/

2° try : I have re-dowload the file php-5.5.29-Win32-VC11-x64.zip and replaced the php_curl.dll 2° 尝试:我重新下载了文件php-5.5.29-Win32-VC11-x64.zip并替换了php_curl.dll

But I have always the same result: index.php但我总是得到相同的结果: index.php

Fatal error: Call to undefined function curl_exec()致命错误:调用未定义的函数curl_exec()

phperror_log:

[22-Sep-2015 13:13:30 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.5.29/ext/php_curl.dll' - Impossibile trovare il modulo specificato.in Unknown on line 0 [2015 年 9 月 22 日 13:13:30 UTC] PHP 警告: PHP 启动:无法加载动态库 'c:/wamp/bin/php/php5.5.29/ext/php_curl.dll' - Impossibile trovare il modulospecificato .in 未知第0

These steps worked for me:这些步骤对我有用:

  1. Add the main php folder onto the Path Env variable in Windows (so libeay32.dll and ssleay32.dll are path-accessible ... some people copy these to Windows/System32 to make them path-accessible but that isn't really elegant way to solve issue)将主要的 php 文件夹添加到 Windows 中的 Path Env 变量(因此 libeay32.dll 和 ssleay32.dll 是路径可访问的……有些人将它们复制到 Windows/System32 以使它们可路径访问,但这并不是真正优雅的方式解决问题)
  2. Add the Apache bin folder onto the Path Env variable in Windows将 Apache bin 文件夹添加到 Windows 中的 Path Env 变量

  3. Copy the file libssh2.dll from the php folder to apache's bin folder (Apache seems to need this for php's curl to work in Windows)将文件 libssh2.dll 从 php 文件夹复制到 apache 的 bin 文件夹(Apache 似乎需要这个来让 php 的 curl 在 Windows 中工作)

PHP Startup: Unable to load dynamic library 'curl' ... Uncommenting 2 lines in the php.ini file solves this PHP 启动:无法加载动态库 'curl' ... 在 php.ini 文件中取消注释 2 行解决了这个问题

Open php.ini Remove semicolon to uncomment ;extension_dir = "ext" Remove semicolon to uncomment ;extension=curl Save php.ini打开 php.ini 去掉分号取消注释;extension_dir = "ext"去掉分号取消注释;extension=curl保存 php.ini

What worked for me:什么对我有用:

  1. I copied libssh2.dll, libcrypto-1_1-x64.dll, libssl-1_1-x64.dll, ssleay32.dll, libeay32.dll to Apache bin folder.我将 libssh2.dll、libcrypto-1_1-x64.dll、libssl-1_1-x64.dll、ssleay32.dll、libeay32.dll 复制到 Apache bin 文件夹。 Probably not all of those are needed.可能并非所有这些都需要。

  2. In php.ini, make sure the extension curl is loaded.在 php.ini 中,确保加载了扩展 curl。 This will be extension=php_curl.dll for php < 7 and extension=curl in php 7这将是 php < 7 的extension=php_curl.dll和 php 7 中的extension=curl

  3. Restart Apache Service重启Apache服务

确保在php.iniextension_dir =指向正确的路径(如果未注释)。

Another possibility is an incompatibility between the version of apache and php, at least if you're using wampserver and/or missing VC++ executables.另一种可能性是 apache 和 php 版本之间不兼容,至少如果您使用 wampserver 和/或缺少 VC++ 可执行文件。 I was using php 7.4.11 and apache 2.4.27.我使用的是 php 7.4.11 和 apache 2.4.27。 Upgrading to apache 2.4.46d and installing missing executables solved the problem.升级到 apache 2.4.46d 并安装丢失的可执行文件解决了这个问题。 That version of apaache also requires updating wampserver to 3.2.5.该版本的 apache 还需要将 wampserver 更新到 3.2.5。 Make sure ALL the windows VC++ executable are installed.确保安装了所有 Windows VC++ 可执行文件。 There is a small tool to check this.有一个小工具可以检查这一点。 The updates and tools are found at https://wampserver.aviatechno.net/更新和工具位于https://wampserver.aviatechno.net/

@see http://forum.wampserver.com/read.php?2,151396 @see http://forum.wampserver.com/read.php?2,151396

I performed the wampserver/apache update and installed some missing VC++ files all at once, so I can't be certain which thing actually fixed the problem loading curl.我执行了 wampserver/apache 更新并一次安装了一些丢失的 VC++ 文件,所以我不能确定哪个东西实际上解决了加载 curl 的问题。

我在 Windows 上遇到了 wamp 的同样错误,当我使用 php 删除另一个应用程序(并产生冲突)并重新安装 wamp 时,问题解决了

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 PHP 启动:无法加载动态库 php_curl.dll - PHP Startup: Unable to load dynamic library php_curl.dll 如何修复 PHP 警告:PHP 启动:无法加载动态库 &#39;ext\\\\php_curl.dll&#39;? - How to fix PHP Warning: PHP Startup: Unable to load dynamic library 'ext\\php_curl.dll'? 消息:PHP启动:无法加载动态库&#39;/usr/lib/php/20151012/php_curl.dll&#39;-/usr/lib/php/20151012/php_curl.dll:无效的ELF标头 - Message: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_curl.dll' - /usr/lib/php/20151012/php_curl.dll: invalid ELF header PHP警告:PHP启动:无法加载动态库&#39;/usr/lib/php/extensions/no-debug-non-zts-20100525/php_curl.dll&#39; - PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20100525/php_curl.dll' PHP - 无法加载动态库&#39;/usr/lib/php/20151012/php_curl.dll&#39; - /usr/lib/php/20151012/php_curl.dll - PHP - Unable to load dynamic library '/usr/lib/php/20151012/php_curl.dll' - /usr/lib/php/20151012/php_curl.dll PHP 无法加载 php_curl.dll 扩展 - PHP unable to load php_curl.dll extension PHP警告:PHP启动:无法加载动态库/usr/lib/php/20151012/php_imap.dll - PHP Warning: PHP Startup: Unable to load dynamic library /usr/lib/php/20151012/php_imap.dll PHP 警告:PHP 启动:无法加载动态库 &#39;\\xampp\\php\\e xt\\php_pgsql.dll - PHP Warning: PHP Startup: Unable to load dynamic library '\xampp\php\e xt\php_pgsql.dll 警告:PHP 启动:无法加载动态库 - Warning: PHP Startup: Unable to load dynamic library 无法打开php_curl.dll - Unable to open php_curl.dll
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM