Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error: Class 'evseevnn\Cassandra\Database' not found in #70

Open
anhphuong opened this issue Sep 12, 2015 · 2 comments
Open

Fatal error: Class 'evseevnn\Cassandra\Database' not found in #70

anhphuong opened this issue Sep 12, 2015 · 2 comments

Comments

@anhphuong
Copy link

I'm starting try use this lib, but it have that error at index.php file
My php is 5.5
My code here:

$nodes = [
127.0.0.1'
];
try {
// Connect to database.
$database = new \evseevnn\Cassandra\Database($nodes, 'demodb');
$database->connect();

Please tell me how to fix!

Thanks

@mahana123
Copy link

Hi, I am new to cassadra and searching for the php driver and got this one after implementing this i also get the same error! I tries to write an auto loader using spl_autoload_register() but failed to meet the driver requirement and sudenly i found "Unavailable exception" in the issue section of this project and i sure that additional files required(vendor directory, use composer to get the directory)

@mahana123
Copy link

After composer install command you will get a "vendor" directory then use this code


namespace evseevnn; include_once(DIR.DIRECTORY_SEPARATOR."vendor".DIRECTORY_SEPARATOR."autoload.php");

$nodes = [
    '127.0.0.1',
    '127.0.0.1:9042' => [
        'username' => '<user_name>',
        'password' => '<password>'
    ]
];

// Connect to database.
$database = new Cassandra\Database($nodes, '<keyspace>');
$database->connect();
// Run query.
$users = $database->query('SELECT * FROM "test"');
var_dump($users);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants