1

I am able to run it through the browser but not from command line

ie php test.php

$raw = Cassandra::cluster()
              ->withContactPoints('localhost')
              //->withCredentials($this->username, $this->password)
              ->build();
 var_dump($raw);                       

die;

from browser:

object(Cassandra\DefaultCluster)#2 (0) { }

command line:

PHP Fatal error: Class 'Cassandra' not found in /var/www/html/test.php on line 2

Is it possible to get same from command line as well?

Dharman
  • 30,962
  • 25
  • 85
  • 135
Rajeev Ranjan
  • 4,152
  • 3
  • 28
  • 41

1 Answers1

2

The cli uses a different php.ini file (e.g. /etc/php/7.0/cli/php.ini & /etc/php/7.0/fpm/php.ini). You are probably not including the extension in the cli one.

Bart
  • 863
  • 8
  • 19