I have a bit of an awkward situation. I want php to monitor the output of a running shell script in real time. For this to work, AJAX is obviously required, or else I would get no output until the entire bash script was finished running (useless since the point of the application is to interact with the script). My problem is that the application needs to be started by a main script, and then accessed by the response script for the AJAX request. Is there any form of variable scope in PHP that will allow me to pass something other than string data from one PHP script to another? If I can't find anything I'll have to resort to using screen outside of PHP in order to keep the process running and then every time I need an update screen will have to connect to the running process, read from it, then disconnect again, and that just seems terribly messy. Can PHP pass pointers between scripts?
-conartist6
Variable scope: Passing a pipe between AJAX scripts.
Moderator: General Moderators
-
conartist6
- Forum Newbie
- Posts: 2
- Joined: Fri Jul 09, 2010 2:18 pm
Re: Variable scope: Passing a pipe between AJAX scripts.
Nope, can't pass file handles between scripts.
If you want to monitor output, have the process dump to a file and make your script read from that... unless there's a specific way to communicate with the process and get information, in which case you should use that.
If you want to monitor output, have the process dump to a file and make your script read from that... unless there's a specific way to communicate with the process and get information, in which case you should use that.
-
conartist6
- Forum Newbie
- Posts: 2
- Joined: Fri Jul 09, 2010 2:18 pm
Re: Variable scope: Passing a pipe between AJAX scripts.
Ok, thats what I need to know. Thanks. Perhaps I'll take this over to C...