Answer by vinit agrawal for How to execute shell commands synchronously in PHP
Both exec and system wait for the script to execute unless you don't fork.Check.php<?php echo "here ".__LINE__."\n"; exec ("php phpscript1.php"); echo "here ".__LINE__."\n"; system("php...
View ArticleAnswer by ChrisH for How to execute shell commands synchronously in PHP
In my opinion, it would be better to run cronjobs. They will execute synchronously. If the task is "on-the-fly", you could execute the command to add this cronjob. More information about...
View ArticleAnswer by Daniel Lopes for How to execute shell commands synchronously in PHP
Check out the exec function syntax on php.net.You will see that exec does not run anything asynchronously by default.exec has two other parameters. The third one, return_var can give you a hint if the...
View ArticleAnswer by stivlo for How to execute shell commands synchronously in PHP
PHP exec will wait until the execution of the called program is finished, before processing the next line, unless you use & at the end of the string to run the program in background.
View ArticleAnswer by Dennis for How to execute shell commands synchronously in PHP
If I'm getting you right, you're executing php scripts from inside a php script.Normally, php waits for the execution of the exec ("php phpscript1.php"); to finish before processing the next line.To...
View ArticleHow to execute shell commands synchronously in PHP
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...
View Article