title: No alive nodes found in your cluster
body: <p>I installed elasticsearch <a href="https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/_quickstart.html" rel="nofollow noreferrer">with the help of this link</a> . </p>
  
  <pre><code>require 'vendor/autoload.php';
  use Elasticsearch\ClientBuilder;
  
  $client = ClientBuilder::create()-&gt;setHosts(["localhost:9200"])-&gt;build();  
  $response = ''; 
  try{
      $params = [
          'index' =&gt; 'my_index',
          'type' =&gt; 'my_type',
          'id' =&gt; 'my_id',
          'body' =&gt; ['testField' =&gt; 'abc']
      ]; 
      $response = $client-&gt;indices()-&gt;create($params);        
  }catch(Exception $e){
      echo "Exception : ".$e-&gt;getMessage();
  }
  print_r($response);
  die('End : Elastic Search');
  </code></pre>
  
  <p>It returns me <strong>No alive nodes found in your cluster</strong>.
  When I change the port to 80</p>
  
  <pre><code>$client = ClientBuilder::create()-&gt;setHosts(["localhost:80"])-&gt;build();
  </code></pre>
  
  <p>it gave me below error. </p>
  
  <p><strong>Method Not Allowed. The requested method PUT is not allowed for the URL /my_index.</strong></p>