简体   繁体   English

使用PHP连接到Cassandra数据库

[英]Connecting to Cassandra Database Using PHP

I am trying to develop both an Android application and a web front end that will allow me to connect to and query a Cassandra database running on my local host. 我正在尝试开发一个Android应用程序和一个Web前端,这将允许我连接并查询在本地主机上运行的Cassandra数据库。

I currently have Cassandra 2.0.5, Thrift 1.0.0, JRE 7u51, PHP 5.3.10, Apache 2.2.22 我目前有Cassandra 2.0.5,Thrift 1.0.0,JRE 7u51,PHP 5.3.10,Apache 2.2.22

I have scoured the internet for a good explanation of how to get this all set up but have failed to really understand exactly how this all should work. 我在互联网上搜寻了如何进行所有设置的很好的解释,但并没有真正真正地理解这一切应该如何工作。 My understanding is that my PHP files on my server will talk to the Cassandra database through the thrift interface and in order to facilitate this most people use higher level PHP libraries. 我的理解是,我服务器上的PHP文件将通过Thrift接口与Cassandra数据库进行通信,并且为了方便起见,大多数人都使用更高级别的PHP库。 I think this may be where my disconnect is. 我认为这可能是我断开连接的地方。 I don't understand how to install or incorporate these libraries with my project. 我不了解如何在我的项目中安装或合并这些库。 I have looked at YaCassandraPDO and PHPCassa. 我看过YaCassandraPDO和PHPCassa。

When trying some of these libraries the errors in Apache seem to indicate that the libraries are installed incorrectly or possibly missing components. 当尝试这些库中的某些库时,Apache中的错误似乎表明库安装不正确或可能缺少组件。

I would appreciate any guidance anyone can provide. 任何人都可以提供任何指导,我将不胜感激。 Thank you! 谢谢!

Please check this PHP library http://evseevnn.github.io/php-cassandra-binary/ 请检查此PHP库http://evseevnn.github.io/php-cassandra-binary/

It is written by me, and how to work with it is similar to the PDO wrapper. 它是由我编写的,如何使用它与PDO包装器相似。 Maybe it will suit you. 也许它将适合您。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM