OK,
I did a few creative searches, and I kinda hit the road block.
I am trying to use the linux "sox" program. I am trying to call this from my PHP script. script DOES work if I use the command line. However, when I use PHP exec, it does not work.
Example:
sox file1.mp3 file2.mp3 tempfile.mp3 -V3
("V3" indicates verbose output)
When executed on the command line as "User X" or as root, I can create a new file. However, when I execute a command like:
<?php exec('sox file1.mp3 file2.mp3 tempfile.mp3 -V3', $output); foreach($output as $line){ print $line; }
It does not generate a new file. In addition, the array that should return the results of the command is empty.
I made simple text with
exec(ls,$output);
and I get the contents of the root directory.
I used the PHP get_current_user() command, and it returned the owner of the directory, which is the root of the website.
However, when I use the linux whoami , I find that it is viewing the current user as "apache". Should I grant apache permissions to use the program?
I will continue to search the Internet and conduct trial and error to find out what I am doing wrong. Any help is appreciated.
Explanation
- I'm not in safe mode (I checked phpinfo () page ")
source share