0
votes

I create server on linode and installed Ubuntu 15.10 and in my console, enter command for install php

apt-get update
apt-get install -y php5
sudo apt-get install php5-dev

Then, I Installed software: boost, openssl, libtool и cmake

sudo apt-get install libboost-all-dev
sudo apt-get install openssl
apt-get install cmake

sudo apt-get install automake libtool curl
curl -sSL https://github.com/libuv/libuv/archive/v1.4.2.tar.gz | sudo tar zxfv - -C /usr/local/src
cd /usr/local/src/libuv-1.4.2
sudo sh autogen.sh
sudo ./configure
sudo make 
sudo make install
sudo rm -rf /usr/local/src/libuv-1.4.2 && cd ~/
sudo ldconfig
sudo apt-get install libssl-dev

And then, I installed cassnadra use datastax documentation

echo "deb http://debian.datastax.com/community stable main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
curl -L http://debian.datastax.com/debian/repo_key | sudo apt-key add -
sudo apt-get update
sudo apt-get install dsc20=2.0.11-1 cassandra=2.0.11

I checked cassnadra

sudo service cassandra status

and i get it:

● cassandra.service - LSB: distributed storage system for structured data
   Loaded: loaded (/etc/init.d/cassandra)
   Active: active (running) since Mon 2016-02-08 09:12:59 EST; 21s ago
     Docs: man:systemd-sysv-generator(8)
   CGroup: /system.slice/cassandra.service
           └─27880 java -ea -javaagent:/usr/share/cassandra/lib/jamm-0.2.5.jar -XX:+CMSClassUnloadingEnabled -XX:+UseThreadPriorities -XX:Threa...

Feb 08 09:12:59 ubuntu systemd[1]: Starting LSB: distributed storage system for structured data...
Feb 08 09:12:59 ubuntu systemd[1]: Started LSB: distributed storage system for structured data.

I check the status of the cluster and cqlsh:

sudo nodetool status

and get:

Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address    Load       Tokens  Owns (effective)  Host ID                               Rack
UN  127.0.0.1  41.32 KB   256     100.0%            2eaa4bd9-136d-4c2a-a65e-7444eb9d8824  rack1

and:

Connected to Test Cluster at localhost:9160.
[cqlsh 4.1.1 | Cassandra 2.0.11 | CQL spec 3.1.1 | Thrift protocol 19.39.0]
Use HELP for help.

Everything is working! finally I try install PHP Driver for Cassandra use this:

git clone https://github.com/datastax/cpp-driver.git
cd cpp-driver
cmake . && make && make install
ln -s libcql.so.0.7.0 /usr/lib/libcql.so.0
ln -s /usr/lib/libcql.so.0 /usr/lib/libcql.so
git clone https://github.com/aparkhomenko/php-cassandra.git
cd php-cassandra
phpize && ./configure && make

But I get Error

checking for specified location of CQL library... yes, shared
checking for CQL in default path... not found
configure: error: Please reinstall the cassandra distribution

Where is my mistake?

1

1 Answers

1
votes

I think that the problem is that you are installing the Cassandra's driver for C/C++:

git clone https://github.com/datastax/cpp-driver.git

Instead, you have to use the PHP one:

git clone https://github.com/datastax/php-driver.git
cd php-driver
git submodule update --init
cd ext
./install.sh

Then, add the extension in the php.ini. For apache2:

echo -e "; DataStax PHP Driver\nextension=cassandra.so" >> /etc/php5/cli/php.ini
echo -e "; DataStax PHP Driver\nextension=cassandra.so" >> /etc/php5/apache2/php.ini

/etc/init.d/apache2 reload

Everything you did prior to that was ok.

Source: https://github.com/datastax/php-driver/blob/master/ext/README.md