title: curl 403 forbidden
body: <p>I am getting a 'You don't have permission to access /rest/02/put.php on this server.' message while using following.</p>
  
  <p>This is put-service-consumer.php</p>
  
  <pre><code>&lt;?php
  $url = 'http://127.0.0.1/rest/02/put.php';
  $fh = fopen('data.txt', 'r');
  $data = file_get_contents('data.txt');
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_INFILE, $fh);
  curl_setopt($ch, CURLOPT_INFILESIZE, strlen($data));
  curl_setopt($ch, CURLOPT_PUT, true);
  curl_exec($ch);
  curl_close($ch);
  ?&gt;
  </code></pre>
  
  <p>This is put-service.php</p>
  
  <pre><code>&lt;?php
  $putdata = fopen("php://input", "r");
  echo $putdata."here";
  $fp = fopen("put_data_file.txt", "a");
  while ($data = fread($putdata, 1024))
    fwrite($fp, $data);
  fclose($fp);
  fclose($putdata);
  ?&gt; 
  </code></pre>
  
  <p>This is an example from restful php webservice book. While examples for get and post works, examples for delete and put isn't working.
  Thanks for any help in advance. </p>