Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You cannot access HBase directly from PHP, but you can workaround it by taking a closer look at the Thrift interface.</p> <p>There's multiple parts to setting it up:</p> <p><strong>First:</strong></p> <p>Thrift is a system for inter-language communication and is not specific to HBase. The interface specification that HBase has looks <a href="http://svn.apache.org/viewvc/hbase/trunk/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift?view=markup" rel="noreferrer">like this</a>.</p> <p>To use the Thrift interface, you need to compile the specification for the language you are using, in this case, PHP. To do this, you need the Thrift compiler (you can get it at thrift.apache.org).</p> <p>Complile it:</p> <blockquote> <p>thrift --gen php [hbase-root]/src/java/org/apache/hadoop/hbase/thrift/Hbase.thrift</p> </blockquote> <p>This will generate a few PHP interface file. Drop that into your project along with the Thrift library files (that came with the compiler).</p> <p>An example of using Thrift and PHP can be found here: http:// svn.apache.org/viewvc/thrift/trunk/tutorial/php/PhpServer.php?view=markup - the functions and methods you call will be the ones you see in the interface file.</p> <p><strong>Second:</strong></p> <p>You need to have a Thrift server running that will do the actual connection to HBase. Instructions are <a href="http://wiki.apache.org/hadoop/Hbase/ThriftApi" rel="noreferrer">on the HBase site</a>, but for the most part you should just need to:</p> <blockquote> <p>[hbase-root]/bin/hbase thrift start</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload