I have been searching through several questions similar to this but i have found no answer suitable for me, especially for Windows system. I have installed PHP and Apache ona Windows machine. I have an app which calls Page1.php. In Page1 i execute some code and at an specific point I would like to launchanother php script, let`s call it Script.php asynchronously. I don´t need to pass any parameter to this second script -if I could it could be helpful but it´s not mandatory- and I don´t need to wait for the script to finish beacuse i don´t want to retain the communication with the user, since script makes a lot of operations with files and it can last quite a long time. I have seen and tried answers based on exec, popen, shell, system and so on...but I haven´t found the right one for me, maybe because I´m working on Windows.These have beeen some of the solutions I have tried without anysuccess:
exec('php script.php &> /dev/null &');
shell_exec('php script.php &> /dev/null &');
system('php script.php &> /dev/null &');
php script.php &> /dev/null &`
The schema could be more or less as follows:
PAGE1.PHP
<?php
echo "Hello World";
echo "\n";
....
if ($var>$var2) {
HERE CALL SCRIPT.PHP ASYNC
}
...
?>
SCRIPT.php
<?php
...
...
?>