title: How to get sphinx connection failed error in php
body: <p>this is my code: </p>
  
  <pre><code>    include_once( "extensions/sphinxapi.php" );
      $mode = SPH_MATCH_EXTENDED2;
      $host = "localhostt"; //am giving wrong to get error
      $port = 9312;
      $ranker = SPH_RANK_NONE;
      $ranker = SPH_RANK_PROXIMITY_BM25;
  
      $cl = new SphinxClient();
      $cl-&gt;GetLastError();    //this line is Not working
      $testcon=$cl-&gt;SetServer ( $host, $port );
      if($testcon){ print_r($cl); }else if(!($testcon)) {echo "show error";}
      $cl-&gt;SetConnectTimeout ( 1 );
      $cl-&gt;SetArrayResult ( true );
      $cl-&gt;SetWeights ( array ( 100,50,100,100,100,100,100,100,100,100,100,100,100,100,100));
      $cl-&gt;SetMatchMode ( $mode );
      $cl-&gt;SetSortMode(SPH_SORT_EXTENDED, $sortby);
      $cl-&gt;SetRankingMode ($ranker);
      $cl-&gt;ResetFilters();
  </code></pre>
  
  <p>sphinx working properly. that is not a problem. but if i give the host name with wrong name means it doesnot show any error.</p>
  
  <pre><code>$host = "localhostt";//like this
  $c1-&gt;GetLastError(); //not working Gives empty result .
  $c1-&gt;GetLastWarning(); //not working also gives empty result.
  </code></pre>
  
  <p>how can i get the connection failed error. i need to show the error in my site.Thanks.</p>