Both exec and system wait for the script to execute unless you don't fork.
Check.php
<?php echo "here ".__LINE__."\n"; exec ("php phpscript1.php"); echo "here ".__LINE__."\n"; system("php phpscript2.php"); echo "here ".__LINE__."\n";?>
phpscript1.php
<?phpecho "=================phpscript1.php\n";sleep(5);?>
phpscript2.php
<?php echo "=================phpscript2.php\n"; sleep(5); ?>
Check.php execute script1 for 5 seconds then display next line number and then execute script2 by printing the next line.