Class 'Aerospike' not found

Below is my code:

<?php
$abhi ='test';
echo 'abhinav';
echo "\n";

connectAero('127.0.0.1');
function connectAero($hosts) {

        $config = array('hosts'=> $hosts);
        $db = new Aerospike(['hosts'=>[['addr'=>'127.0.0.1', 'port'=>3000]]]);
        if (!$db->isConnected()) {

                echo "<div class='alert alert-danger'> Aero Error ".$db->errorno(). ":". $db->error()."<div>";
                exit(1);

        }
        return $db;
}
?>
I am new to Aerospike and not much examples or documentation available, when above code is executed it throws an error as mentioned:

abhinav
PHP Fatal error:  Class 'Aerospike' not found in /home/ec2-user/aero.php on line 10
PHP Stack trace:
PHP   1. {main}() /home/ec2-user/aero.php:0
PHP   2. connectAero() /home/ec2-user/aero.php:6

Hi @abhidix89,

This seems like an installation issue. What Operating System are you running the PHP client on and how did you install it?

Have a look at the following links for installation instructions and examples.

https://www.aerospike.com/docs/client/php/install/

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.