I have an exe file which has the following code:
while(1)
printf("hello\n");
I'm executing this exe through php using shell_exec
$output = shell_exec('C:/Users/thekosmix/Desktop/hello.exe 2>&1');
echo $output;
now the script is executing for very long time untill i kill the process from task manager and it gives fatal error:
(Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 133693440 bytes) in C:\xampp\htdocs\shell\index.php on line 7)
I want the script (or this function) to run for a given time duration and print whatever output is generated during the time-duration not any fatal error. set_time_limit() is also not solving the problem.