0

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]

Yorrd
  • 726
  • 1
  • 7
  • 20
  • Maybe output contains some special characters that prevent it from being captured or displayed. Do you see the output using `passthru` function? – baf Apr 03 '15 at 13:28
  • Have you tried running the command with the user under which the PHP script is executed? – mrun Apr 03 '15 at 13:33
  • @baf passthru doesn't return the output, just the status. How can I check whether it contains weird characters? – Yorrd Apr 03 '15 at 14:09

0 Answers0