kmaid Posted July 14, 2007 Share Posted July 14, 2007 Hi, I am trying to run a console application which needs to keep running even after the php script has finished executing. I also need the PID or some sort of handle I can use to kill the program at a later stage. Thanks kmaid **Edit the machines are all windows (windows2000 and windows web edition)*** Link to comment https://forums.phpfreaks.com/topic/59971-help-executing-a-program/ Share on other sites More sharing options...
Guardian-Mage Posted July 14, 2007 Share Posted July 14, 2007 Read about automated tasks and CGI. It also depends on server types I suppose(Windows, Linux) Link to comment https://forums.phpfreaks.com/topic/59971-help-executing-a-program/#findComment-298302 Share on other sites More sharing options...
kmaid Posted July 14, 2007 Author Share Posted July 14, 2007 I dont think automated tasks will help me as i need the PID back and would like to avoid using CGI. Im trying to use user defined services and making their name a handle i can start and stop but it looks like alot of work having to edit the registry each time. I would like to avoid it though are there any better ways on windows? Kmaid Link to comment https://forums.phpfreaks.com/topic/59971-help-executing-a-program/#findComment-298456 Share on other sites More sharing options...
keeB Posted July 15, 2007 Share Posted July 15, 2007 I think you can call an external app.. maybe java, and get the PID there. I had a solution in mind for python, but it ended up not working out. Basically, though, I can provide you with the flow. External app has one job. Spawn process for app mentioned in STDIN, and the PID is returned to STDOUT. You then use http://php.net/exec to get the PID. Only method I can think of. Link to comment https://forums.phpfreaks.com/topic/59971-help-executing-a-program/#findComment-298483 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.