[英]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:
这是服务器的当前状态:
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 中:
C:\\php
into C:\\apache\\bin
C:\\php
复制到C:\\apache\\bin
C:\\php
into C:\\apache\\bin
(if it doesn't exist)C:\\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...和魔法……问题解决了……
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.