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