I am using php to write inputs I receive from browser into a text file.Than I use shell_exec() to execute a program on server that writes those inputs from the text file and write its output to another text file. Now after my program has written its output I want to read this text file from php and send it back to the browser. Can someone please guide me how I can do this. Thanks
Instead of writing output to another file, just display them. The output can be capture from shell_exec() like this: $output=shell_exec('some_command.sh'); echo $output PHP:
Thanks Weizheng for your response, but the issue here is that its not simple output. The program does some processing on images and outputs images. So my problem is what to do in the php script while the program is executing and how to know when the output file has been written.