I installed aws cli on my local Ubuntu 18.04 development machine. It works fine from the terminal for example if i type:
$which aws I get: /usr/local/bin/aws. However, if i try to run this command from within a php script it does nothing.
$cmd ="aws --version";
try {
$exec = exec($cmd,$output, $return);
$exec2 = shell_exec($cmd);
}
catch(Exception $e)
{
echo 'Message: ' .$e->getMessage();
}
exec2 returns null exec returns 127.
Now I understand that this is a paths issue and I have tried to add it to the path but it does not work.
I know this can be done using the php sdk but for various reasons i cant use that.
Can someone explain how to get this working on ubuntu 18.04 with php?