Quantcast
Channel: How to execute shell commands synchronously in PHP - Stack Overflow
Viewing all articles
Browse latest Browse all 6

How to execute shell commands synchronously in PHP

$
0
0

I need to run multiple scripts(5 scripts) via cmd, I want to make sure unless and until the first script finishes the second should not initiate. Thus after first script completes then only second should being then third one and so on..Currently I am using the following code to do this

exec ("php phpscript1.php ");exec ("php phpscript2.php ");exec ("php phpscript3.php ");exec ("php phpscript4.php ");exec ("php phpscript5.php ");

I think these scripts run asynchronously, any suggestion guys so that these scripts can be run synchronously.


Viewing all articles
Browse latest Browse all 6

Latest Images

Trending Articles





Latest Images