title: Querying database through Hive/Thrift in PHP does not work
body: <p>I'm trying to query a database through Hive/Thrift in PHP. However, I am constantly getting an error:</p>
  
  <pre><code>TSocket: timed out reading 4 bytes from XYZ
  </code></pre>
  
  <p>I'm using a code from </p>
  
  <p><a href="https://cwiki.apache.org/Hive/hiveclient.html#HiveClient-PHP" rel="nofollow">https://cwiki.apache.org/Hive/hiveclient.html#HiveClient-PHP</a></p>
  
  <p>along with this PHP Thrift Client </p>
  
  <p><a href="https://github.com/garamon/php-thrift-hive-client" rel="nofollow">https://github.com/garamon/php-thrift-hive-client</a></p>
  
  <p>My code:</p>
  
  <pre><code>&lt;?php
  
  $socket    = new TSocket( 'XYZ', 12345 );
  
  $socket-&gt;setSendTimeout(30 * 1000);
  $socket-&gt;setRecvTimeout(30 * 1000);
  
  $transport = new TBufferedTransport( $socket, 1024, 1024 );
  $protocol  = new TBinaryProtocol( $transport );
  
  $client    = new ThriftHiveClientEx( $protocol );
  
  $transport-&gt;open();
  
  $client-&gt;execute("my query");
  
  ?&gt;
  </code></pre>
  
  <p>Note - I am able to connect with XYZ through console (telnet command).</p>
  
  <p>I would appriciate any help. Thanks.</p>