Exec() in loop failed!

hello guys, i have a php code as below:

for ( $i=0;$i<$count;$i++)
	$fh = fopen($myFile, 'w') or die("can't open file");
 	fwrite($fh, $eigenvalue[$i]);

	$newchk = intval($chk[$i]) ^ intval($id[$i]);

	$fh_2 = fopen($myFile_2, 'w') or die("can't open file");
 	fwrite($fh_2, $newchk);
	$fh_3 = fopen($myFile_3, 'w') or die("can't open file");
 	fwrite($fh_3, $id[$i]);

The main problem is when it comes to second loop, the exec() function didn’t work. why is that?

This your code is taking a lot of resources with multiple fopen inside a loop

Are you sure it enters the loop the second time?
And how do you know the exec isn’t executed? What does ‘./Assign_fingerprint’ do?