Https://wiki.fourkitchens.com/display/PF/Using+Cassandra+with+PHP
1. Down the thrift code.
Http://incubator.apache.org/thrift/download/
2. Building the PHP Client
2.1 configure and build thrift.
./Configuremake
2.2 build the PHP thrift interface for Cassandra:
./Compiler/CPP/thrift-gen PHP ../path-to-Cassandra/interface/Cassandra. Thrift
2.3 copy the include files to a useful place (per the Cassandra "Getting started" Guide ):
Mkdir-P/usr/share/PHP/thriftcp-r gen-PHP // usr/share/PHP/thrift/packages/CP-r lib/PHP/src/*/usr /share/PHP/thrift/
3. Building and installing the native PHP Extension
Installing and using the native PHP extension provides approximately a ten-fold performance boost on writing data.
3.1 change to path-to-Thrift/lib/PHP/src/EXT/thrift_protocol.
3.2 install support for building PHP extensions:
/Usr/local/webserver/PHP/bin/phpize./configure -- enable-thrift_protocol -- With-PHP-Config =/usr/local/webserver/PHP/bin/PHP-configmake
3.3 copy the extension's. So to the extensions directory.
CP modules/thrift_protocol.so/usr/local/webserver/PHP/lib/PHP/extensions/no-debug-non-zts-20060613/
3.4 enable the module.
Edit PHP. ini and add: Extension = thrift_protocol.so
3.5 then restart PHP-FPM
4. Checking the connection
4.1 copy in the PHP from the Cassandra client examples page to/var/www/cassandra-test.php.
4.2 visit http: // localhost/cassandra-test.php in the browser.
4.3 On the first load, the array output shocould be empty. On the second, there shocould be content.