You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Amrita Jayakumar <am...@gmail.com> on 2011/05/31 16:03:51 UTC

starting with PHPcassa

I have log files of the format <id> <key> <value>. I want to load these
files into cassandra using PHPcassa.
I have installed Cassandra 7. Can anyone please guide me with the exact
procedures as in how to install PHPcassa and take things forward?

Thanks and Regards,
Amrita

Re: starting with PHPcassa

Posted by Sasha Dolgy <sd...@gmail.com>.
http://thobbs.github.com/phpcassa/installation.html

If you already have the log files, pycassa (python) may be better
suited and quicker ....

http://pycassa.github.com/pycassa/

On Tue, May 31, 2011 at 4:03 PM, Amrita Jayakumar
<am...@gmail.com> wrote:
> I have log files of the format <id> <key> <value>. I want to load these
> files into cassandra using PHPcassa.
> I have installed Cassandra 7. Can anyone please guide me with the exact
> procedures as in how to install PHPcassa and take things forward?

Re: starting with PHPcassa

Posted by Sasha Dolgy <sd...@gmail.com>.
Create a file with <?php phpinfo(); ?> in it.
View it in your browser
In the first section see where it is loading php.ini from

Failing that http://www.php.net/
On Jun 1, 2011 7:04 AM, "Amrita Jayakumar" <am...@gmail.com>
wrote:
> Hi Maki,
> I have extracted phpcassa-0.7.a.4 and now i am trying to
> configure the C extension.
> For that as per the link mentioned by you, i've installed it. now what is
> left is to add the line
>
> *extension=thrift_protocol.so*
>
> into the *php.ini* file. But wen i fired *locate php.ini* i got many of
them
> in the following locations.
>
> /etc/php5/apache2/php.ini
> /etc/php5/cgi/php.ini
> /etc/php5/cli/php.ini
> /usr/share/doc/php5-common/examples/php.ini-development
> /usr/share/php5/php.ini-production
> /usr/share/php5/php.ini-production-dist
> /usr/share/php5/php.ini-production.cli
>
> So into which file should i add it???
>
> Thanks and Regards,
> Amrita
>
>
> On Tue, May 31, 2011 at 7:48 PM, Maki Watanabe <watanabe.maki@gmail.com
>wrote:
>
>> http://thobbs.github.com/phpcassa/installation.html
>>
>> They also have mailing list and irc channel.
>> http://thobbs.github.com/phpcassa/
>>
>> maki
>>
>>
>> 2011/5/31 Amrita Jayakumar <am...@gmail.com>:
>> > I have log files of the format <id> <key> <value>. I want to load these
>> > files into cassandra using PHPcassa.
>> > I have installed Cassandra 7. Can anyone please guide me with the exact
>> > procedures as in how to install PHPcassa and take things forward?
>> >
>> > Thanks and Regards,
>> > Amrita
>> >
>>
>>
>>
>> --
>> w3m
>>

Re: starting with PHPcassa

Posted by Maki Watanabe <wa...@gmail.com>.
Amrita,
I recommend you to take a bit more time to investigate, think, and
struggle on the problems by yourself before posting questions.
It will increase your technical skill, and help you much when you will
face on really serious problem in future.

For the current problem, if I am you, I'll make a small php script
without cassandra thing and verify it works fine at first.

maki

2011/6/1 Amrita Jayakumar <am...@gmail.com>:
> yeh i tried restarting... but i get to see the following
>
>  /etc/init.d/apache2 restart
>  * Restarting web server apache2
>    apache2: Could not reliably determine the server's fully qualified domain
> name, using 127.0.0.1 for ServerName
>  ... waiting apache2: Could not reliably determine the server's fully
> qualified domain name, using 127.0.0.1 for ServerName
>
> Thanks and Regards,
> Amrita
>
> On Wed, Jun 1, 2011 at 11:50 AM, Marcus Bointon <ma...@synchromedia.co.uk>
> wrote:
>>
>> On 1 Jun 2011, at 08:12, Amrita Jayakumar wrote:
>>
>> I have deployed this code into a php file phcass.php in the ubuntu machine
>> in the location /var/www/vishnu/. But nothing happens when i execute the
>> file through the browser. Neither can i find the data inserted in the column
>> family 'Users'.
>> can anyone help???
>>
>> Did you restart apache after changing that PHP config?
>> Are you certain it's running at all? instead of that echo, try
>> var_dump($column_family);
>> Marcus
>

Re: starting with PHPcassa

Posted by Amrita Jayakumar <am...@gmail.com>.
yeh i tried restarting... but i get to see the following

 /etc/init.d/apache2 restart
 * Restarting web server apache2
   apache2: Could not reliably determine the server's fully qualified domain
name, using 127.0.0.1 for ServerName
 ... waiting apache2: Could not reliably determine the server's fully
qualified domain name, using 127.0.0.1 for ServerName

Thanks and Regards,
Amrita

On Wed, Jun 1, 2011 at 11:50 AM, Marcus Bointon
<ma...@synchromedia.co.uk>wrote:

> On 1 Jun 2011, at 08:12, Amrita Jayakumar wrote:
>
> I have deployed this code into a php file *phcass.php* in the ubuntu
> machine in the location */var/www/vishnu/*. But nothing happens when i
> execute the file through the browser. Neither can i find the data inserted
> in the column family '*Users*'.
> can anyone help???
>
>
> Did you restart apache after changing that PHP config?
>
> Are you certain it's running at all? instead of that echo, try
> var_dump($column_family);
>
> Marcus
>

Re: starting with PHPcassa

Posted by Marcus Bointon <ma...@synchromedia.co.uk>.
On 1 Jun 2011, at 08:12, Amrita Jayakumar wrote:

> I have deployed this code into a php file phcass.php in the ubuntu machine in the location /var/www/vishnu/. But nothing happens when i execute the file through the browser. Neither can i find the data inserted in the column family 'Users'.
> can anyone help???

Did you restart apache after changing that PHP config?

Are you certain it's running at all? instead of that echo, try var_dump($column_family);

Marcus

Re: starting with PHPcassa

Posted by Amrita Jayakumar <am...@gmail.com>.
Hi,

     I have a column family Users. at present these are two keys in it.

    *ajayakumar {*
         => (column=age, value=22, timestamp=1306820564285000)
         => (column=first, value=amrita, timestamp=1306820515836000)
         => (column=last, value=jayakumar, timestamp=1306820548681000)
     *}*

*    agomathy* *{
*         => (column=age, value=25, timestamp=1306820588655000)
         => (column=first, value=amrita, timestamp=1306820655045000)
         => (column=last, value=gomathy, timestamp=1306820637375000)
*    } *in it.

    Now I am trying to write a php code to establish a connection to
cassandra and to insert a new key *vkrishnan *into the column family *Users*.


<?
require_once('phpcassa/connection.php');
require_once('phpcassa/columnfamily.php');
$servers = array("localhost");
$pool = new ConnectionPool("Keyspace1", $servers);
$column_family = new ColumnFamily($pool, 'Users');
$column_family->insert('vkrishnan', array('first' => 'vishnu' , 'last' =>
'krishnan' , 'age' => '22' ));

echo $column_family;

?>

I have deployed this code into a php file *phcass.php* in the ubuntu machine
in the location */var/www/vishnu/*. But nothing happens when i execute the
file through the browser. Neither can i find the data inserted in the column
family '*Users*'.
can anyone help???


Thanks and Regards,
Amrita

On Wed, Jun 1, 2011 at 10:56 AM, Marcus Bointon
<ma...@synchromedia.co.uk>wrote:

> On 1 Jun 2011, at 07:21, Amrita Jayakumar wrote:
>
> > so i just should create a directory phpcassa in the location
> /etc/php5/conf.d/  and  in phpcassa just create a file php.ini and include
> the line extension=thrift_protocol.so in it????
>
> Nearly. Just run this:
>
> echo 'extension=thrift_protocol.so' > /etc/php5/conf.d/phpcassa.ini
>
> Marcus

Re: starting with PHPcassa

Posted by Marcus Bointon <ma...@synchromedia.co.uk>.
On 1 Jun 2011, at 07:21, Amrita Jayakumar wrote:

> so i just should create a directory phpcassa in the location /etc/php5/conf.d/  and  in phpcassa just create a file php.ini and include the line extension=thrift_protocol.so in it????

Nearly. Just run this:

echo 'extension=thrift_protocol.so' > /etc/php5/conf.d/phpcassa.ini

Marcus

Re: starting with PHPcassa

Posted by Amrita Jayakumar <am...@gmail.com>.
so i just should create a directory *phpcassa *in the location*/etc/php5/conf.d/
*  and  in *phpcassa* just create a file* php.ini* and include the line *
extension=thrift_protocol.so* in it????

Thanks and Regards,
Amrita

On Wed, Jun 1, 2011 at 10:44 AM, Marcus Bointon
<ma...@synchromedia.co.uk>wrote:

> On 1 Jun 2011, at 07:03, Amrita Jayakumar wrote:
>
> into the *php.ini* file. But wen i fired *locate php.ini* i got many of
> them in the following locations.
>
> /etc/php5/apache2/php.ini
> /etc/php5/cgi/php.ini
> /etc/php5/cli/php.ini
> /usr/share/doc/php5-common/examples/php.ini-development
> /usr/share/php5/php.ini-production
> /usr/share/php5/php.ini-production-dist
> /usr/share/php5/php.ini-production.cli
>
>
> None! I'd put it by itself in a /etc/php5/conf.d/phpcassa then it will be
> used by all environments and you won't be troubled by it when you do package
> updates in future.
> All the ones in /usr/share are examples. Ideally the ones in /etc/php5 will
> be approximately copies of the production examples.
>
> Marcus
>

Re: starting with PHPcassa

Posted by Marcus Bointon <ma...@synchromedia.co.uk>.
On 1 Jun 2011, at 07:03, Amrita Jayakumar wrote:

> into the php.ini file. But wen i fired locate php.ini i got many of them in the following locations.
> 
> /etc/php5/apache2/php.ini
> /etc/php5/cgi/php.ini
> /etc/php5/cli/php.ini
> /usr/share/doc/php5-common/examples/php.ini-development
> /usr/share/php5/php.ini-production
> /usr/share/php5/php.ini-production-dist
> /usr/share/php5/php.ini-production.cli

None! I'd put it by itself in a /etc/php5/conf.d/phpcassa then it will be used by all environments and you won't be troubled by it when you do package updates in future.
All the ones in /usr/share are examples. Ideally the ones in /etc/php5 will be approximately copies of the production examples.

Marcus

Re: starting with PHPcassa

Posted by Amrita Jayakumar <am...@gmail.com>.
Hi Maki,
            I have extracted phpcassa-0.7.a.4 and now i am trying to
configure the C extension.
For that as per the link mentioned by you, i've installed it. now what is
left is to add the line

*extension=thrift_protocol.so*

into the *php.ini* file. But wen i fired *locate php.ini* i got many of them
in the following locations.

/etc/php5/apache2/php.ini
/etc/php5/cgi/php.ini
/etc/php5/cli/php.ini
/usr/share/doc/php5-common/examples/php.ini-development
/usr/share/php5/php.ini-production
/usr/share/php5/php.ini-production-dist
/usr/share/php5/php.ini-production.cli

So into which file should i add it???

Thanks and Regards,
Amrita


On Tue, May 31, 2011 at 7:48 PM, Maki Watanabe <wa...@gmail.com>wrote:

> http://thobbs.github.com/phpcassa/installation.html
>
> They also have mailing list and irc channel.
> http://thobbs.github.com/phpcassa/
>
> maki
>
>
> 2011/5/31 Amrita Jayakumar <am...@gmail.com>:
> > I have log files of the format <id> <key> <value>. I want to load these
> > files into cassandra using PHPcassa.
> > I have installed Cassandra 7. Can anyone please guide me with the exact
> > procedures as in how to install PHPcassa and take things forward?
> >
> > Thanks and Regards,
> > Amrita
> >
>
>
>
> --
> w3m
>

Re: starting with PHPcassa

Posted by Maki Watanabe <wa...@gmail.com>.
http://thobbs.github.com/phpcassa/installation.html

They also have mailing list and irc channel.
http://thobbs.github.com/phpcassa/

maki


2011/5/31 Amrita Jayakumar <am...@gmail.com>:
> I have log files of the format <id> <key> <value>. I want to load these
> files into cassandra using PHPcassa.
> I have installed Cassandra 7. Can anyone please guide me with the exact
> procedures as in how to install PHPcassa and take things forward?
>
> Thanks and Regards,
> Amrita
>



-- 
w3m