I want to execute 2 scripts:
exec('python s1 '); //time of execution is 2800s
sleep(3000); // i want to be sure that the first one is finished
From the exec manual page:
If a program is started with this function, in order for it to continue running in the background, the output of the program must be redirected to a file or another output stream. Failing to do so will cause PHP to hang until the execution of the program ends.
In short, PHP will wait for your
python s1 command to finish before continuing.
Note that a execution time of 3000 seconds will most definitely time out without changing the default maximum execution time in the ini file. See How to increase maximum execution time in php.