Jump to content

Help executing a program


kmaid

Recommended Posts

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

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

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.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.