Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to integrate Laravel 5.7 and Cassandra 3.6?

I want to use Cassandra as my noSql database in Laravel 5.7 project. I've found some packages for integrate Cassandra and Laravel, but some of them is outdated.

In this git : https://github.com/ShahinSorkh/laravel-cassandra , it said that we must have datastax php and it only works with php version 5.6., 7.0. and 7.1.*.

My php version is 7.2

Anyone can recommend packages for integrate Laravel and Cassandra that support Laravel 5.7 and php 7.2 or How to integrate it ?

like image 653
Susy Valentina Rahardjo Avatar asked Jan 08 '19 05:01

Susy Valentina Rahardjo


1 Answers

Currently there is no other cassandra php driver (unfortunately!)

However, you could manually compile that driver using this guide. This requires that the c++ driver is also installed which is described on top of the page. Summarized the steps for compiling PHP extension are:

git clone https://github.com/datastax/php-driver.git
pushd ext
phpize
popd
mkdir build
pushd build
../ext/configure
make
make install
popd

Important note: If you need to compile this for 7.4 and above and this throws some errors containing "ulong not defined", you need to apply the changes in this PR.

UPDATE 09/2020: I'm currently working on refactoring my app to get rid of cassandra. Cassandra Libs, especially for PHP, are not well maintained and C++ & PHP drivers are being abandonded by DataStax

like image 59
Stefan Avatar answered Oct 04 '22 12:10

Stefan