1

I add user with right permission in this file:

/etc/httpd/conf/httpd.conf

But shell_exec,system,exec can't run all command. For example I can go to root folder and get list of files and directory in /root folder, but when i use

shell_exec('ffmpeg');

nothing execute and nothing reply. What should i do?

Barmar
  • 741,623
  • 53
  • 500
  • 612
  • try executing 'ls' . do you get anything? – Rafael Shkembi Sep 03 '16 at 07:20
  • 1
    `ffmpeg` needs a filename argument. What do you expect it to do with no argument? – Barmar Sep 03 '16 at 07:26
  • `shell_exec()` returns the output of the command. If you want to see it, you need to echo it with `echo shell_exec('ffmpeg')`. If you also want to see error messages, you should redirect stderr, `echo shell_exec('ffmpeg 2>&1');` – Barmar Sep 03 '16 at 07:27
  • ls,cd /root and other command work very well and return output but when i use shell_exec('fmpeg ...') return is empty but when i type this command in linux terminal convert my file perfectly. – user6790106 Sep 03 '16 at 07:31
  • @barmar the result of `shell_exec('ffmpeg 2>&1');` is `sh: ffmpeg: command not found ` – user6790106 Sep 03 '16 at 07:34
  • Use the full path of the command, since it's not installed in the default search path. – Barmar Sep 03 '16 at 07:34
  • @barmar thanks ,solved.how can run ffmpeg in anywhere? – user6790106 Sep 03 '16 at 10:21

0 Answers0