title: PHP Curl Request returning HTTP Error 411: The request must be chunked or have a content length
body: <p>I'm trying to send the following CURL request in PHP. But its returning: "HTTP Error 411. The request must be chunked or have a content length."  </p>
  
  <p>PHP Script containing the CURL Request:  </p>
  
  <pre><code>&lt;?php
  $numbers = 9999999999;
  $message = "Test";
  $message = urlencode($message);
  $port = 80;
  $url = "http://191.95.51.64/API/sendsms.aspx?loginID=myloginid&amp;password=mypassword&amp;mobile=".$numbers."&amp;text=".$message."&amp;senderid=ABCDEF&amp;route_id=1&amp;Unicode=1";
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt ( $ch, CURLOPT_PORT, $port );
  curl_setopt ( $ch, CURLOPT_POST, 1 );
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt ( $ch, CURLOPT_TIMEOUT, 20 );
  curl_setopt ( $ch, CURLOPT_CONNECTTIMEOUT, 20 );
  $output = curl_exec($ch);
  $err = curl_error($ch);
  curl_close($ch);    
  if ($err) {
      echo $err;
  } else {
      echo $output;
  }
  ?&gt;  
  </code></pre>
  
  <p>Output:  </p>
  
  <pre><code>Length Required
  
  HTTP Error 411. The request must be chunked or have a content length.  
  </code></pre>
  
  <p>Since I'm new to use PHP Curl, so I couldn't be able to find out whats wrong. If anyone can briefly guide me the solution with an example, I'll be very appreciated to him. Thanks!</p>