Running multiple concurrent php scripts from CLI

I have 55 php files that I would like to run simultaneously from the command line. Right now I am running them in several CLI windows using code:

PHP 1.php 

I would like to be able to call a single php file that will execute all 55 php files at once. I read about how to make the command line not wait for exit, but I can not make it work.

This thread: How to run multiple PHP scripts from the command line

offers to put and execute the command in the background at the end of the command, but with the help of CLAMP xampp it does nothing.

Any ideas were greatly appreciated.

Brian

+4
source share
3 answers

Having mentioned XAMPP, I assume that you are on windows. I think you need a start command. You will probably need start PHP 1.php . For more information do

 start /?|more 
+3
source

Linux

Besides adding & , you also need to redirect the output somewhere - otherwise your php process waits until another process terminates, because there may be more results:

 exec('/path/to/program & > /dev/null 2>&1') 
+2
source

You can use php forking mechanism. Read about it here: http://php.net/manual/en/function.pcntl-fork.php

+1
source

All Articles