Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP script to run multiple php scripts in parallel

I am trying to get multiple php scripts to run in Parallel. I am running WAMP meaning no easy access to bash or cronjobs. Hence the attempt to make this work using php only.

<?php
include("test2.php");
include("test3.php");
include("test4.php");
?>

but the test files have a wait command before outputting a line of code. When I run this, it waits for each individual php to finish it's wait time before moving on. I want them to all run at the same time (parallel)

I also tried

system('C:\wamp\bin\php\php5.4.3 test2.php &');

The goal is to make the script run these scripts in parallel, wait for them to finish running in parallel and output an echo that says finished. Am I missing something?

like image 734
SuperMar1o Avatar asked Apr 15 '26 15:04

SuperMar1o


1 Answers

One more thing to think about, if you want this to run in a circle, just add this to the header. It will wait for the iFrames to load and then move to the next page.

<body onload=window.location='parsethem.php'> 
like image 192
Elton John Avatar answered Apr 17 '26 03:04

Elton John