WAMP 卷曲安装

发布于 2024-09-14 13:14:36 字数 769 浏览 2 评论 0原文

我已从 php.ini 文件中取消注释以下内容

;extension=php_bz2.dll
extension=php_curl.dll
;extension=php_dba.dll

另外,我已将 php_curl.dll 复制到 windows\system32 并重新启动 apache 服务器。

我正在测试以下脚本

<?php

$curl_handle=curl_init();
curl_setopt($curl_handle,CURLOPT_URL,'http://example.com');
curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2);
curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);
$buffer = curl_exec($curl_handle);
curl_close($curl_handle);

if (empty($buffer))
{
    print "Sorry, example.com are a bunch of poopy-heads.<p>";
}
else
{
    print $buffer;
}
?>

并收到以下错误

Fatal error: Call to undefined function curl_init() in C:\wamp\www\t.php on line 3

任何帮助将不胜感激?

I have uncomment the following from the php.ini file

;extension=php_bz2.dll
extension=php_curl.dll
;extension=php_dba.dll

Also ,I have copied the php_curl.dll to windows\system32 and restart the apache server.

I am testing the follwoing script

<?php

$curl_handle=curl_init();
curl_setopt($curl_handle,CURLOPT_URL,'http://example.com');
curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2);
curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);
$buffer = curl_exec($curl_handle);
curl_close($curl_handle);

if (empty($buffer))
{
    print "Sorry, example.com are a bunch of poopy-heads.<p>";
}
else
{
    print $buffer;
}
?>

and getting the following error

Fatal error: Call to undefined function curl_init() in C:\wamp\www\t.php on line 3

any help will be appreciated ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

花开浅夏 2024-09-21 13:14:36

确保您已取消注释正确的 php.ini 文件中的扩展名。您应该通过phpinfo()命令检查扩展是否启用。

Make sure that you have uncommented the extension from the right php.ini file. You should check whether or not extension is enabled through phpinfo() command.

最好是你 2024-09-21 13:14:36

或者更简单,单击通知区域(屏幕右下角)中的 wamp 图标,
浏览 PHP > PHP 扩展并单击第二项“php_curl”。
Wamp 将自动重新启动。

Or even simpler, click the wamp icon in the notification area (bottom right of your screen),
go through PHP > PHP extensions and click the second item 'php_curl'.
Wamp will restart automatically.

蓝色星空 2024-09-21 13:14:36

我遇到了同样的问题,我解决了它只是卸载 wamp2_x64(首先安装在 c:\wamp 中)并在文件夹 C:/Program Files (x86)/wamp 中重新安装 wamp_x86。

这似乎解决了问题,我猜这可能是 64 位 dll 的问题。

I ran into the same issue and i solved it just unistalling wamp2_x64(first installed in c:\wamp) and reinstalling wamp_x86 in the folder C:/Program Files (x86)/wamp.

That seems to solve the problem, I guess it might be a problem with the dlls for 64 bits.

蓝天 2024-09-21 13:14:36

WAMP服务器某个包中的php_curl.dll是错误的文件,我也遇到了同样的问题,我在/wamp/bin/php/php[youversion/ext/中找到了正确的php_curl.dll文件并替换了它,它工作了。
请参阅这篇文章: http://forum.wampserver.com/read.php?2,85716

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

極樂鬼 2024-09-21 13:14:36

64 位 Windows 7 也有同样的问题。这对我有用。

Soren 从另一个 SO 线程回答 - CURL for WAMP

“似乎有一个错误如果您在 Win 7 64 位上遇到此问题,请尝试安装 apache 插件版本 2.2.9 和 php 插件版本 5.3.1 并切换到 WAMP 中的插件,然后激活对我有用的 CURL 扩展。”

Had same issue with 64 bit Windows 7. This is what worked for me.

Answered by Soren from another SO thread - CURL for WAMP

"There seems to be a bug somewhere. If you are experiencing this on Win 7 64 bit then try installing apache addon version 2.2.9 and php addon version 5.3.1 and switching to those in WAMP and then activating the CURL extension. That worked for me."

情魔剑神 2024-09-21 13:14:36

我在 Wampserver 2.2(64 位)上遇到了同样的问题。这是我让它工作的方法:

1) 转到 wampserver->PHP->PHP 扩展,启用 php_curl 扩展

2) 打开 \bin\php\php5.3.13\php.ini 并取消注释以下行:
Extension=php_curl.dll

3) 转到 \bin\php 并将 libeay32.dll 和 ssleay32.dll 复制到 windows\system32 文件夹中

4) 如果您尝试重新启动 wampserver 的服务,您会发现 lib_curl 仍然不起作用。事实证明,包中捆绑的 php_curl.dll 版本未正确编译。

Apache 的错误日志包含以下内容:

警告:PHP 启动:无法加载动态库

'c:/wamp/bin/php/php5.3.13/ext/php_curl.dll' - 应用程序无法加载启动,因为它的并行配置不正确。请参阅应用程序事件日志或使用命令行 sxstrace.exe 工具了解更多详细信息。

5) 您需要正确编译的 php_curl.dll 版本。我从这篇博客文章下载了 php_curl-5.3.13-VC9-x64.zip:[www.anindya.com

]

直接链接:

[www.mediafire.com]

我替换了 \bin\php\php5.3.13\ 内的 php_curl.dll ext 与上面的一样,一切正常微笑笑脸
6) 要测试 cURL 扩展是否适合您,请尝试以下代码片段

`

<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,
'http://news.google.com/news?hl=en&topic=t&output=rss');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$contents = curl_exec ($ch);
echo $contents;
curl_close ($ch);
?>

`

这是另一篇包含类似信息的帖子(我在编写这些说明后发现了这一点):
[www.o3n.org]

I had the same problem with Wampserver 2.2 (64 bit). Here's what I did to get it working:

1) Go to wampserver->PHP->PHP extensions, enable the php_curl extension

2) Open \bin\php\php5.3.13\php.ini and uncomment the following line:
extension=php_curl.dll

3) Go to \bin\php and copy libeay32.dll and ssleay32.dll into your windows\system32 folder

4) If you try and restart wampserver's services, you'll notice that lib_curl still doesn't work. Turns out that the version of php_curl.dll bundled in the pack is not compiled correctly.

Apache's error log contained the following:

Warning: PHP Startup: Unable to load dynamic library

'c:/wamp/bin/php/php5.3.13/ext/php_curl.dll' - The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.

5) You'll need a properly compiled version of php_curl.dll. I downloaded php_curl-5.3.13-VC9-x64.zip from this blog post:

[www.anindya.com]

Direct link:

[www.mediafire.com]

I replaced php_curl.dll inside \bin\php\php5.3.13\ext with the one above, and everything worked fine smiling smiley
6) To test if the cURL extension is working for you, try this code snippet

`

<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,
'http://news.google.com/news?hl=en&topic=t&output=rss');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$contents = curl_exec ($ch);
echo $contents;
curl_close ($ch);
?>

`

Here's another post with similar info (I found this after I wrote these instructions):
[www.o3n.org]

水中月 2024-09-21 13:14:36

如果您已经取消了 php.ini 中的行注释并且仍然收到错误
你应该确保这个扩展文件存在于 php 文件夹中,或者不存在

,所以检查这个文件

php_curl.dll

{wamp}\bin\php\php5.xx\ext\

如果不存在,则从互联网下载它并将其粘贴到那里

重新启动 Apache。

if you have already uncommented line from php.ini and still getting error than
you should make sure that this extension file is exists in php folder or not

so check for this file

php_curl.dll

in

{wamp}\bin\php\php5.x.x\ext\

if it's not there than download it from internet and paste it to there

Restart Apache.

一刻暧昧 2024-09-21 13:14:36
  • 下载Windows 版curl (http://curl.haxx.se/download.html)
  • 粘贴将 zip 文件内容复制到 C:\wamp\bin\apache\apache2.2.x
  • 找到并打开 php.ini 文件(位于 C:\wamp\bin\php\php5.x 中)
  • 在 php.ini 文件中,更改/ 取消注释以下行:
    ;extension=php_curl.dll (通过删除分号来实现)
  • 重新启动 Apache 或整个服务器即可享受
  • download curl for windows (http://curl.haxx.se/download.html)
  • Paste the zip file content into C:\wamp\bin\apache\apache2.2.x
  • Locate and open your php.ini file (resides in C:\wamp\bin\php\php5.x)
  • In your php.ini file, change/ uncomment the following line:
    ;extension=php_curl.dll (you do so by removing the semi-colon)
  • restart Apache or the whole server to enjoy
妄断弥空 2024-09-21 13:14:36

这解决了我的问题

  1. 完全停止 WAMP。
  2. 找到您的 WAMP 文件夹 C:\Path\To\WAMP\bin\Apache\ApacheVersion\bin\
  3. 编辑 php.ini 并取消注释 extension=php_curl.dll
  4. 重新启动 WAMP。

这应该有望解决它。

this sloved my problem

  1. Stop WAMP completely.
  2. Find your WAMP folder C:\Path\To\WAMP\bin\Apache\ApacheVersion\bin\
  3. Edit that php.ini and uncomment extension=php_curl.dll
  4. Restart WAMP.

That should hopefully solve it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文