tried to run the following code through a php script running locally on xampp and it returns null.I've tried running the command with exec instead of shell_exec and it returns an empty string as output. I work on Mac running mojave.
$out = shell_exec('security import ~/.bitnami/stackman/machines/xampp/volumes/root/htdocs/keys/ios.cer -k ~/Library/Keychains/app.keychain -P 123456789');
var_dump($out);
when I put the command directly into the terminal it runs successfully and it shows the following message. "1 certificate successfully imported"
I've tried putting the ios.cer file outside htdocs and again it works on terminal and not through php script.
I gave read and write permissions to everyone for the ios.cer file
exec('whoami');
the above command returns daemon. What can I try to make it run through the php script?