WAMP卷曲安装 [英] WAMP Curl installation

查看:33
本文介绍了WAMP卷曲安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从 php.ini 文件中取消了以下注释

I have uncomment the following from the php.ini file

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

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

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

我正在测试以下脚本

<?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

任何帮助将不胜感激?

推荐答案

确保您已从正确的 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.

这篇关于WAMP卷曲安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆