title: curl php HTTP/2 stream 0 was not closed cleanly
body: <p>I am trying to send a request using <code>cURL</code> and <code>PHP</code> and it throws an error.</p>
  
  <blockquote>
    <p>HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)</p>
  </blockquote>
  
  <p>I am sending <code>CURLOPT_HTTP_VERSION</code> like this</p>
  
  <pre><code>curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
  </code></pre>
  
  <p><code>cURL</code> info printed with <code>curel_version()</code> is</p>
  
  <pre><code>Array
  (
      [version_number] =&gt; 475136
      [age] =&gt; 4
      [features] =&gt; 11518877
      [ssl_version_number] =&gt; 0
      [version] =&gt; 7.64.0
      [host] =&gt; x86_64-apple-darwin18.2.0
      [ssl_version] =&gt; OpenSSL/1.0.2q
      [libz_version] =&gt; 1.2.11
      [protocols] =&gt; Array
          (
              [0] =&gt; dict
              [1] =&gt; file
              [2] =&gt; ftp
              [3] =&gt; ftps
              [4] =&gt; gopher
              [5] =&gt; http
              [6] =&gt; https
              [7] =&gt; imap
              [8] =&gt; imaps
              [9] =&gt; ldap
              [10] =&gt; ldaps
              [11] =&gt; pop3
              [12] =&gt; pop3s
              [13] =&gt; rtmp
              [14] =&gt; rtsp
              [15] =&gt; scp
              [16] =&gt; sftp
              [17] =&gt; smb
              [18] =&gt; smbs
              [19] =&gt; smtp
              [20] =&gt; smtps
              [21] =&gt; telnet
              [22] =&gt; tftp
          )
  
      [ares] =&gt; 1.15.0
      [ares_num] =&gt; 69376
      [libidn] =&gt; 
      [iconv_ver_num] =&gt; 0
      [libssh_version] =&gt; libssh2/1.8.0
      [brotli_ver_num] =&gt; 16777223
      [brotli_version] =&gt; 1.0.7
  )
  </code></pre>
  
  <p><code>PHP</code> version: <code>PHP Version =&gt; 7.3.2</code></p>
  
  <p>installed with <code>homebrew</code>.</p>
  
  <p>I have tried almost all of the solutions here on SO, but still getting the same error. Do I need to download and compile <code>PHP</code> from source? Any clue/suggestion would be a huge help. Thanks.</p>