Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/226.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 卷曲无法使用APN倒带身体_Php_Curl_Apple Push Notifications - Fatal编程技术网

Php 卷曲无法使用APN倒带身体

Php 卷曲无法使用APN倒带身体,php,curl,apple-push-notifications,Php,Curl,Apple Push Notifications,我正在尝试使用APN向iOS设备发送消息,但始终收到以下消息: cURL错误0:cURL请求重试了3次,未成功。失败的最可能原因是cURL无法倒回请求主体,随后的重试导致了相同的错误。打开“调试”选项以查看出了什么问题。看见https://bugs.php.net/bug.php?id=47204 了解更多信息。(见http://curl.haxx.se/libcurl/c/libcurl-errors.html) 我尝试过禁用/启用https,但似乎没有任何区别。标题看起来与它们的完全相同,但

我正在尝试使用APN向iOS设备发送消息,但始终收到以下消息:

cURL错误0:cURL请求重试了3次,未成功。失败的最可能原因是cURL无法倒回请求主体,随后的重试导致了相同的错误。打开“调试”选项以查看出了什么问题。看见https://bugs.php.net/bug.php?id=47204 了解更多信息。(见http://curl.haxx.se/libcurl/c/libcurl-errors.html)

我尝试过禁用/启用https,但似乎没有任何区别。标题看起来与它们的完全相同,但不想造成任何差异。有人有什么想法吗

这是我的密码:

$payload = [
        "aps" =>  [
            "alert" => "Message received from Bob"
        ]
    ];

$client = new Client();
    $response = $client->request(
        'POST',
        'https://api.development.push.apple.com:443',
        [
            'body' => \GuzzleHttp\json_encode($payload),
            'headers' =>
                [
                    'Authorization' => "Bearer: $token",
                    ':method' => 'POST',
                    ':scheme' => 'https',
                    ':path' => "/3/device/$deviceId",
                    'apns-expiration' => 0,
                    'apns-priority' => 10
                ],
            'debug' => true,
        ]
    );
卷曲版本信息:

array (size=9)
  'version_number' => int 470272
  'age' => int 3
  'features' => int 573981
  'ssl_version_number' => int 0
  'version' => string '7.45.0' (length=6)
  'host' => string 'x86_64-apple-darwin10.8.0' (length=25)
  'ssl_version' => string 'OpenSSL/1.0.1p' (length=14)
  'libz_version' => string '1.2.8' (length=5)
  'protocols' => 
    array (size=20)
      0 => string 'dict' (length=4)
      1 => string 'file' (length=4)
      2 => string 'ftp' (length=3)
      3 => string 'ftps' (length=4)
      4 => string 'gopher' (length=6)
      5 => string 'http' (length=4)
      6 => string 'https' (length=5)
      7 => string 'imap' (length=4)
      8 => string 'imaps' (length=5)
      9 => string 'ldap' (length=4)
      10 => string 'ldaps' (length=5)
      11 => string 'pop3' (length=4)
      12 => string 'pop3s' (length=5)
      13 => string 'rtsp' (length=4)
      14 => string 'smb' (length=3)
      15 => string 'smbs' (length=4)
      16 => string 'smtp' (length=4)
      17 => string 'smtps' (length=5)
      18 => string 'telnet' (length=6)
      19 => string 'tftp' (length=4)

客户端类。什么是FQN?来自Laravel,所以GuzzleHttp\Client;我还需要看你
var_dump(curl_version())可能重复查看,似乎我对xamp/curl有很多问题。我会调查一下,看看进展如何。谢谢你的信息