In the following:
exec('sudo -u myuser pactl list sink-inputs 2>&1', $output, $err);
$output
is an empty array and $err
is 0
.
Any other command works fine, for example sudo -u myuser pactl info
or sudo -u myuser whoami
work just fine and return the result as an array.
EDIT:
When I do
sudo -u http sudo -u myuser pactl list sink-inputs
in order to replicate the php behavior, it gives me an error. Therefore this question doesn't belong here and is about pactl returning an error in this case.
[closed]