0

I wish to do recording of the live http streaming on the server side. I am able to do the recording on server via ssh and then writting the vlc -I rc command But when i write the same command in the exec function like :- exec("vlc -I rc REST_OF_THE_COMMAND"); IT doesnt works , But exec("ls -l") & exec("pwd") works

So my problem is that vlc command line is not working with the exec or shell_exec function.

abhishek
  • 1,434
  • 7
  • 39
  • 71
  • typing vlc in command line launches the vlc player but in this case even the code shell_exec("vlc") is not working. I am running the php on my localhost – abhishek Jun 11 '12 at 11:47

1 Answers1

1

Please check this answer (relates to executing commands from PHP). Once you know the exact problem, then it is easier to find a solution.

Executing wkhtmltopdf from PHP fails

Community
  • 1
  • 1
dakdad
  • 2,947
  • 2
  • 22
  • 21
  • Thanks for your comment. if i type vlc in command line then the vlc player is launched and now if i type $output = shell_exec("vlc 2>&1"); print_r(''.$output); i get sh: vlc command not found – abhishek Jun 11 '12 at 12:48
  • 1
    Well, that's your problem - vlc is not in the path as far as apache is concerned. You need update the apache PATH to include the dir where vlc executable is located – dakdad Jun 11 '12 at 16:07
  • Thanks for the tip man. Where shall i update the apache PATH ? is it in httpd-vhosts.conf file>>? – abhishek Jun 11 '12 at 19:27
  • Depends on your system configuration. Here is one that's on Mac http://stackoverflow.com/questions/2837697/how-do-i-add-paths-to-the-apache-path-variable – dakdad Jun 12 '12 at 17:33