title: How do I log the raw HTTP headers with a PHP script?
body: <p>I'm using a cURL script to send POST data through a proxy to a script and I want to see what raw HTTP headers the cURL script is sending. List of things I've tried:</p>
  
  <ul>
  <li><code>echo curl_getinfo($ch, CURLINFO_HEADER_OUT)</code> gives no output.</li>
  <li><code>file_get_contents('php://input')</code> gets some HTTP headers but not all.</li>
  <li><code>print_r($_SERVER)</code> also gets some HTTP headers but not all (I know this because there should be a X-Forwarded-For header and there isn't)</li>
  <li>Printing all superglobals ($_POST, $_GET, $_REQUEST, $_FILES etc) still doesn't show the raw HTTP headers.</li>
  <li><code>http_get_request_headers()</code>, <code>apache_request_headers()</code>, <code>$http_response_header</code>, <code>$HTTP_RAW_POST_DATA</code> aren't outputting everything.</li>
  </ul>
  
  <p>Help?</p>