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
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

Link to comment
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.