How to run a command in terminal php on FreeBSD?

You need to run the command
sox media/60847/intro.wav -r 8000 -c 1 media/60847/intro.gsm

I tried using exec, nothing happens, I understand that a human (whoami gives the user www). How to run a command under a different user?
Googled using sudo, is it possible without installing it to do?
April 4th 20 at 00:44
2 answers
April 4th 20 at 00:46
I understand because of rights

The most important thing to understand about programmingis that you never have to understand.
And it is always necessary to know exactly.
And especially don't start to rush and to make chaotic movements, the installation type sudo, prescribing ways and other things that are based on understanding.

If something goes wrong, then the system always informs you about it. And you just have to take this message and read. And then to correct the specific error.

Is uncomfortable use normal exec shell_exec().
to see the error that is added to the end of the command 2>&1

$out = shell_exec("sox media/60847/intro.wav -r 8000 -c 1 media/60847/intro.gsm 2>&1");

in out will the console output, including error.
Read the error and fix it
OK, promotion is issued sox: not found
Does this mean that the www user does not have access to sox? - Cade.Reichert32 commented on April 4th 20 at 00:49
April 4th 20 at 00:48
where does the user?
try the full path to the files to the team...
the same command works in terminal root access - Cade.Reichert32 commented on April 4th 20 at 00:51
what? - Joesph commented on April 4th 20 at 00:54

Find more questions by tags LinuxPHPFreeBSD