python - order of executing shell_exec in php -


i want execute 2 scripts: s1 , s2. s2 must executed after s1. time of execution of s1 2800 seconds, , need execute s2 after s1. should put sleep(3000) in php between them, or second 1 execute automatically after first one?

i tried this:

exec('python s1 '); //time of execution 2800s  sleep(3000); // want sure first 1 finished  shell_exec('php /home/parik/s2.php'); 

from exec manual page:

if program started function, in order continue running in background, output of program must redirected file or output stream. failing cause php hang until execution of program ends.

in short, php wait python s1 command finish before continuing.

note execution time of 3000 seconds time out without changing default maximum execution time in ini file. see how increase maximum execution time in php.


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -