ホームページ  >  に質問  >  本文

php fsockopen win10本地调用接口正常,linux nginx下调用失败,openssl开启了,不知道为什么?

    $params = json_encode($template,JSON_UNESCAPED_UNICODE);
    $fp = fsockopen('api.weixin.qq.com', 80, $error, $errstr, 1);
    $http = "POST /cgi-bin/message/template/send?access_token={$access_token} HTTP/1.1 ".PHP_EOL."Host: api.weixin.qq.com".PHP_EOL."Content-type: application/x-www-form-urlencoded".PHP_EOL."Content-Length: " . strlen($params) .PHP_EOL. "Connection:close".PHP_EOL.PHP_EOL.$params.PHP_EOL.PHP_EOL;
    fwrite($fp, $http);
    fclose($fp);
phpcn_u1582phpcn_u15822690日前422

全員に返信(2)返信します

  • 迷茫

    迷茫2017-05-16 12:04:37

    カールを使って移動

    返事
    0
  • 巴扎黑

    巴扎黑2017-05-16 12:04:37

    disable_functions を表示するには phpinfo を印刷します

    返事
    0
  • キャンセル返事