无法打开流:HTTP请求失败! HTTP / 1.0 500内部服务器错误

时间:2018-06-18 13:06:35

标签: php

function marketcurencylist($auth,$id)
{
    $context = stream_context_create(
        array("ssl"=>array(
            'verify_peer'=>false,
            'verify_peer_name'=>false,
        ),

        'http' => array(
        'method' => 'GET',
        'header' => "Content-Type: application/json\r\n"."Authorization:".$auth."\r\n",
        )
    ));
    $response = file_get_contents(api_url().'market/allactivemarketslist', false, $context);
    return $response;
}
  

无法打开流:HTTP请求失败! HTTP / 1.0 500内部服务器错误

1 个答案:

答案 0 :(得分:0)

必须在服务器上禁用

allow_url_fopen。您可以尝试通过php.ini启用它或考虑使用cURL函数。