curl_init() has been disabled for security reasons

后端 未结 4 437
既然无缘
既然无缘 2021-01-14 10:28
$url= \"http://api.stackoverflow.com/1.1/search?tagged=php\";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRAN         


        
相关标签:
4条回答
  • 2021-01-14 10:55

    Contact your hosting! :)

    Or try:

    file_get_contents('http://api.stackoverflow.com/1.1/search?tagged=php');
    // Most likely it's also blocked.
    

    You can also try to download with streams.

    Or use sockets and connect directly to server and send a HTTP request and parse the response yourself.

    There are ways, don't know if they work on your setup... if cURL is not available.

    0 讨论(0)
  • 2021-01-14 11:02

    If you are on xampp look below

    How to enable curl in xampp?

    you should only need to change this php

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

    0 讨论(0)
  • 2021-01-14 11:04

    Open your php.ini file and check for disable_functions over there. And see whether your curl_init is packed there or not! Here is More information

    0 讨论(0)
  • 2021-01-14 11:19

    From your php.ini remove those above functions from disable_functions.

    How to locate the php.ini file (xampp)

    php.ini file is available in xamp folder

    0 讨论(0)
提交回复
热议问题