I have a webpage which has some input tags which are passed to PHP to validate it and then php creates a command for another Python script to run and command is executed using $output = shell_exec($cmd); The Python script is a Selenium script which gives some output/status of what's going on while it's doing.
My question is that is there any way that I can use PHP to shell_exec the command created and display the output of Python script continuously? I can get all the output after the command is executed and not while the script is executing.
I searched on Google but didn't find any help. I read these answers, but they are not helping me...
Python: how to show results on a web page?
Display python script output to HTML page
How to run python script in webpage
How to continuously display Python output in a Webpage?
I don't want to use Flask or Django because my rest of the code is in PHP.
shell_exec()which per documentation first executes and the returns. Take a look at theproc_openfunction php offers: php.net/manual/en/function.proc-open.php You will find various examples on the internet for this.shell_execetc. don't use this method. Just create another loopback service for easily manage/cache control.