出于安全原因,curl_init()已被禁用 [英] curl_init() has been disabled for security reasons

查看:84
本文介绍了出于安全原因,curl_init()已被禁用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

$url= "http://api.stackoverflow.com/1.1/search?tagged=php";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_ENCODING, ""); // this will handle gzip content
$result = curl_exec($ch);
curl_close($ch);
print $result;

错误

Warning: curl_init() has been disabled for security reasons on line 2

Warning: curl_setopt() has been disabled for security reasons on line 3

Warning: curl_setopt() has been disabled for security reasons on line 4

Warning: curl_setopt() has been disabled for security reasons on line 5

Warning: curl_setopt() has been disabled for security reasons on line 6

Warning: curl_exec() has been disabled for security reasons on line 7

Warning: curl_close() has been disabled for security reasons on line 8

我可以知道我的Curl不起作用的原因吗?

May i Know the reason why my Curl not working ?

推荐答案

如果您使用的是xampp,请看下面的

If you are on xampp look below

如何在xampp中启用curl?

您只需要更改此php

you should only need to change this php

C:\ Program Files \ xampp \ php \ php.ini

C:\Program Files\xampp\php\php.ini

这篇关于出于安全原因,curl_init()已被禁用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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