Does PHP's exec() function always wait?

Discussion in 'PHP' started by samie, Feb 5, 2014.

  1. #1
    I just wanted to clarify, does PHPs exec() function always wait for whatever command to finish?

    Like for example,

    exec('wget http://some-random-domain/videos/video/largevideo.mp4');
    PHP:
    Say the mp4 file is 100MB, will it wait to download that before continuing with the script? I plan on doing something like this, maybe even ffmpeg related where things need to be processed, but I just don't want to start something and have my PHP script try to do something when it hasn't yet been downloaded/processed.
     
    samie, Feb 5, 2014 IP
  2. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #2
    yes it will wait until whatever you are providing as parameter has finished. doesn't matter if it succeeds or fails.
     
    stephan2307, Feb 6, 2014 IP