简体   繁体   English

PHP 启动:无法加载动态库 php_curl.dll

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

I am having trouble getting cURL working on one of my servers.我在我的一台服务器上运行 cURL 时遇到问题。 I have others set up exactly like this and they are working.我有其他人完全像这样设置,他们正在工作。 Here is the error message in the system log:这是系统日志中的错误消息:

PHP Fatal error: Call to undefined function curl_init()

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

I've been researching this all day and nothing has worked.我一整天都在研究这个,但没有任何效果。 Here's the current state of the server:这是服务器的当前状态:

  • php.ini is in C:\\php\\ php.ini 在 C:\\php\\
  • php_curl.dll is in C:\\php\\ext\\ php_curl.dll 在 C:\\php\\ext\\
  • libeay32.dll and ssleay32.dll are in C:\\php\\ libeay32.dll 和 ssleay32.dll 在 C:\\php\\
  • extension=php_curl.dll is uncommented in php.ini extension=php_curl.dll 在 php.ini 中没有注释
  • Environment variable PATH = %SystemRoot%\\system32;%SystemRoot%;%SystemRoot%\\System32\\Wbem;%SYSTEMROOT%\\System32\\WindowsPowerShell\\v1.0\\;C\\php;C:\\php\\ext;C:\\Apache24\\bin环境变量PATH = %SystemRoot%\\system32;%SystemRoot%;%SystemRoot%\\System32\\Wbem;%SYSTEMROOT%\\System32\\WindowsPowerShell\\v1.0\\;C\\php;C:\\php\\ext;C:\\Apache24 \\bin
  • phpinfo() shows that C:\\php\\php.ini is the config file being used phpinfo() 显示 C:\\php\\php.ini 是正在使用的配置文件
  • php.ini extension_dir = "C:\\php\\ext" php.ini extension_dir = "C:\\php\\ext"
  • Apache is from here阿帕奇来自这里
  • PHP is from here PHP 来自这里
  • OS is Windows Server 2008 R2 Datacenter操作系统是 Windows Server 2008 R2 Datacenter

I've restarted several times.我已经重启好几次了。 Other extensions are loading from the extension directory.其他扩展正在从扩展目录加载。 I've also tried re-downloading the PHP zip file and replacing C:\\php with the contents of the freshly downloaded zip file.我还尝试重新下载 PHP zip 文件并将 C:\\php 替换为新下载的 zip 文件的内容。 I had this problem on a different server a while back when I was updating PHP and Apache.不久前,当我更新 PHP 和 Apache 时,我在另一台服务器上遇到了这个问题。 Replacing C:\\php with a new copy of the zip file did fix it, but it is not helping now.用 zip 文件的新副本替换 C:\\php 确实修复了它,但现在没有帮助。

I will be happy to provide any additional information you may need.我很乐意提供您可能需要的任何其他信息。

Thanks.谢谢。


phpinfo() configure command phpinfo() 配置命令

cscript /nologo configure.js "--enable-snapshot-build" "--disable-isapi" "--enable-debug-pack" "--without-mssql" "--without-pdo-mssql" "--without-pi3web" "--with-pdo-oci=c:\\php-sdk\\oracle\\x86\\instantclient_12_1\\sdk,shared" "--with-oci8-12c=c:\\php-sdk\\oracle\\x86\\instantclient_12_1\\sdk,shared" "--enable-object-out-dir=../obj/" "--enable-com-dotnet=shared" "--with-mcrypt=static" "--without-analyzer" "--with-pgo" . cscript /nologo configure.js "--enable-snapshot-build" "--disable-isapi" "--enable-debug-pack" "--without-mssql" "--without-pdo-mssql" "--without-pi3web" "--with-pdo-oci=c:\\php-sdk\\oracle\\x86\\instantclient_12_1\\sdk,shared" "--with-oci8-12c=c:\\php-sdk\\oracle\\x86\\instantclient_12_1\\sdk,shared" "--enable-object-out-dir=../obj/" "--enable-com-dotnet=shared" "--with-mcrypt=static" "--without-analyzer" "--with-pgo"

In PHP 7.3:在 PHP 7.3 中:

  1. extension=php_curl扩展=php_curl
  2. copy libssh2.dll from C:\\php into C:\\apache\\binlibssh2.dllC:\\php复制到C:\\apache\\bin
  3. copy libcrypto-*.dll and libssl-*.dll from C:\\php into C:\\apache\\bin (if it doesn't exist)libcrypto-*.dlllibssl-*.dllC:\\php复制到C:\\apache\\bin (如果不存在)

Oops, "C\\php" in PATH was missing a colon.糟糕,PATH 中的“C\\php”缺少一个冒号。 Changed it to "C:\\php" and it works now.将其更改为“C:\\php”,现在可以使用了。 I had a feeling it would turn out to be something like this... Oh well.我有一种感觉,结果会是这样的……哦,好吧。

We have faced similar problem in our Environment.我们在我们的环境中遇到了类似的问题。

We uninstalled Apache and installed it again with following commands:我们卸载了 Apache 并使用以下命令重新安装:

c:\Apache\bin httpd -k uninstall 
c:\Apache\bin httpd -k install 

and magic.... The problem is solved...和魔法……问题解决了……

In PHP 7.4:在 PHP 7.4 中:

It's a problem related to Windows , if you are using Apache2.x + Php , the trick consists in using LoadFile to force the loading of CURL as explained in my Guide .这是一个与Windows相关的问题,如果您使用的是Apache2.x + Php ,诀窍在于使用LoadFile强制加载CURL如我的指南中所述 You don't need strange things or rituals to have CURL working on your machine, you only need edit httpd.conf and add this:你不需要奇怪的事情或仪式来让CURL在你的机器上工作,你只需要编辑httpd.conf并添加以下内容:

# load CURL library on Windows
LoadFile "${SRVROOT}/php/libssh2.dll"

Hope this helps.希望这可以帮助。

Unable to load dynamic library 'C:\\php\\ext\\php_curl.dll'无法加载动态库 'C:\\php\\ext\\php_curl.dll'

correct answer should workable as environment path for c:\\php is missed .正确答案应该可行,因为 c:\\php 的环境路径丢失了。 so just add所以只需添加

In Control Panel -> Search -> Advanced System Settings and use the button Environment Variables.在控制面板 -> 搜索 -> 高级系统设置中并使用按钮环境变量。

Under System Variables find Path add the c:\\php folder (or whatever path) and restart Apache.在 System Variables find Path 添加 c:\\php 文件夹(或任何路径)并重新启动 Apache。

就我而言,问题是我在 C:\\Windows\\System32 中的文件之前获取了另一个位于 PATH 中的 curl.exe 文件

also you need to change the curl.dll version, you must overwrite the version that comes with wamp server.还需要更改curl.dll版本,必须覆盖wamp服务器自带的版本。 C:/wamp/bin/php/ext. C:/wamp/bin/php/ext.

You can download the right version from this link您可以从此链接下载正确的版本

http:// www.mediafire.com/download/3ay381k3cq59cm2/php_curl-5.4.3-VC9-x64.zip HTTP:// www.mediafire.com/download/3ay381k3cq59cm2/php_curl-5.4.3-VC9-x64.zip

I hope it works for you!我希望这个对你有用!

font: http://forum.wampserver.com/read.php?2,85716,85932字体: http : //forum.wampserver.com/read.php?2,85716,85932

暂无
暂无

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

相关问题 PHP 警告:PHP 启动:无法加载动态库 php_curl.dll 不可能找到 - PHP Warning: PHP Startup: Unable to load dynamic library php_curl.dll impossibile find 如何修复 PHP 警告:PHP 启动:无法加载动态库 'ext\\\\php_curl.dll'? - How to fix PHP Warning: PHP Startup: Unable to load dynamic library 'ext\\php_curl.dll'? 消息:PHP启动:无法加载动态库'/usr/lib/php/20151012/php_curl.dll'-/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 - 无法加载动态库'/usr/lib/php/20151012/php_curl.dll' - /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启动:无法加载动态库'/usr/lib/php/extensions/no-debug-non-zts-20100525/php_curl.dll' - PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20100525/php_curl.dll' PHP 无法加载 php_curl.dll 扩展 - PHP unable to load php_curl.dll extension 无法打开php_curl.dll - Unable to open php_curl.dll PHP启动:无法加载动态库“ php_pthreads.dll” - PHP Startup: Unable to load dynamic library 'php_pthreads.dll' PHP启动无法加载动态库php_mongodb.dll - PHP Startup Unable to load dynamic library php_mongodb.dll PHP 启动:无法加载动态库 'php_mongodb.dll' - PHP Startup: Unable to load dynamic library 'php_mongodb.dll'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM