I'm using a for
loop to speed up my script. The problem is that each process that happens inside of the loop takes several minutes to load. Is it possible to move on the next sequence in the loop if the previous one hasn't completed? I know that PHP isn't a multi-threaded language, so perhaps Python would be a better choice.
ini_set('memory_limit', '2048M');
ini_set('max_execution_time', 0);
$list = file_get_contents('auth.txt');
$list = nl2br($list);
$exp = explode('<br />', $list);
$count = count($exp);
for($i=0;$i<$count;$i++) {
$auth = $exp[$i];
echo 'Trying '.$auth.'
';
// This takes several minutes. Is it possible to move on to the next one before it has completed?
exec('python test.py --auth='.$auth);
}