【问题标题】:running Cassandra from php shell command (using datastax php-driver)从 php shell 命令运行 C​​assandra(使用 datastax php-driver)
【发布时间】:2017-02-08 16:26:53
【问题描述】:

我可以通过浏览器运行它,但不能从命令行运行它

即php test.php

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

die;

来自浏览器:

对象(Cassandra\DefaultCluster)#2 (0) { }

命令行:

PHP 致命错误:在第 2 行的 /var/www/html/test.php 中找不到类“Cassandra”

是否也可以从命令行获得相同的结果?

【问题讨论】:

    标签: php cassandra-2.1 datastax-php-driver


    【解决方案1】:

    cli 使用不同的 php.ini 文件(例如 /etc/php/7.0/cli/php.ini/etc/php/7.0/fpm/php.ini)。您可能没有在 cli 中包含扩展名。

    【讨论】:

      猜你喜欢
      • 2015-07-17
      • 1970-01-01
      • 2013-04-20
      • 1970-01-01
      • 2013-11-28
      • 2022-11-28
      • 2014-04-21
      • 1970-01-01
      • 2016-07-31
      相关资源
      最近更新 更多