Hi i am trying to execute a php script from cmd with some data given through a GET request but i cant get it to wait for completion of the command for some reason.
The code is.
<?php
error_reporting(0);
file_put_contents("query.txt", $_GET['query']);
exec("php loop1.php");
$result=file_get_contents("result.html");
echo $result;
?>
the code of loop1 is too complicated and not the point of the question.
Rather than using the implicit ‘php’ CLI tool perhaps you would have better luck via the more explicit path for the given install/platform, ie:
(be sure to first set $phpcli to contain the correct explicit path to PHP)