Page 1 of 1

Running 2 scripts at the same time

Posted: Fri Dec 15, 2006 3:12 pm
by amir
Hello,

I have script (scriptA.php) that loops through lots of data and makes some operations on each loop. This takes some time to run, around 20-200 secs.

Also, i have another script (scriptB.php) that show statistics about the processes scriptA.php makes.

I run scriptA.php and scriptB.php in their own window. My problem is, scriptB.php does not print statistics results until scriptA.php finishes its processes.

How can I make scriptB.php work even scriptA.php didn't finish its processes?

TIA!

Posted: Fri Dec 15, 2006 3:18 pm
by Kieran Huggins
the pcntl_fork() function might be what you're looking for.. take a look in the manual here: http://www.php.net/manual/en/ref.pcntl.php

There are some good tutorials on the net for how to use this function

Cheers,
Kieran