am using windows-7 OS and wamp server. i have 2 php files trigger.php,background.php. i want to run background.php in background .i have to call this file from trigger.php
function execInBackground($cmd) { if (substr(php_uname(), 0, 7) == "Windows"){ pclose(popen("start /B ". $cmd, "r")); } else { exec($cmd . " > /dev/null &"); } }
in this case your $cmd would be "php C:/wamp/www/path/to/background.php"
$cmd
"php C:/wamp/www/path/to/background.php"