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

Answer by Dennis for How to execute shell commands synchronously in PHP

$
0
0

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 avoid this, just redirect the output to /dev/null or a file and run it in background.

For example: exec ("php phpscript1.php >/dev/null 2>&1 &");.


Viewing all articles
Browse latest Browse all 6

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>