I am having difficulties to get continuous outputs from C in PHP.

So I have made a simple example to explain what I am trying to achieve.

Given test.c is my C program that displays continuous outputs

test.c

```
#include <stdio.h>

int main(int c, char **v)
{
    int counter = 0;
    while(1)
    {
        printf("%d\n",counter);
        counter++;
        sleep(2+rand()%4);
    }
    return 0;
}

```

Then compiled with

```
gcc -o test test.c 

```

C program is run in test.sh below:

test.sh

```
#!/bin/sh

./test

```

Then make test.sh executable with:

```
chmod +x test.sh

```

Now I want to get the continuous ouptut from C in test.php

test.php

```
<?php

    shell_exec("./test.sh");
?>

```

when run on command line client with below command nothing shows.

```
php test.php

```

Please how can I solve this issue.