This is a discussion on Possible to check to see if Windows process is running from PHP? within the PHP Language forums, part of the PHP Programming Forums category; I need to check the state of a processes from within a PHP script on a Windows machine. All I ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I need to check the state of a processes from within a PHP script on a
Windows machine. All I need to know is whether or not the process exists (i.e., is running). Anyone have any ideas? I searched the archives and found proc_open(), but if it can do what I'm trying to do, I can't figure out how. |
|
|||
|
<wrybread@gmail.com> wrote in message
news:1108937050.288502.91410@o13g2000cwo.googlegro ups.com... > I need to check the state of a processes from within a PHP script on a > Windows machine. All I need to know is whether or not the process > exists (i.e., is running). Anyone have any ideas? > > I searched the archives and found proc_open(), but if it can do what > I'm trying to do, I can't figure out how. > Google for tlist.exe (pre-XP) or tasklist.exe (XP). |
|
|||
|
On Mon, 21 Feb 2005 00:27:20 -0500, "Chung Leong" <chernyshevsky@hotmail.com>
wrote: ><wrybread@gmail.com> wrote in message >news:1108937050.288502.91410@o13g2000cwo.googlegr oups.com... >> I need to check the state of a processes from within a PHP script on a >> Windows machine. All I need to know is whether or not the process >> exists (i.e., is running). Anyone have any ideas? >> >> I searched the archives and found proc_open(), but if it can do what >> I'm trying to do, I can't figure out how. >> > >Google for tlist.exe (pre-XP) or tasklist.exe (XP). There's also some goodies here that may be of use: http://www.sysinternals.com/ntw2k/fr.../pstools.shtml (And various other useful tools on that site) -- Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk> <http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool |
|
|||
|
>>I need to check the state of a processes from within a PHP script on
a >>Windows machine. All I need to know is whether or not the process >>exists (i.e., is running). Anyone have any ideas? >>I searched the archives and found proc_open(), but if it can do what >>I'm trying to do, I can't figure out how. Curious. Why do you need to do this? What processes runnng in Windows are you interested in? |
|
|||
|
I built a photobooth, and PHP does the scripting. So the PHP script
(running in Windows) tells a program called PSRemote to take 4 pictures, then PHP passes the pictures to a Photoshop droplet to arrange them in a strip, then prints them, then the PHP script uploads the pics. The problem is, if someone clicked the button to take more pics while the script was running, it would crash. So a kludgey solution was to check if the processes php.exe was running, and if so abort. In essence I'm preventing multiple instances of the script. Here's the photobooth, if you're interested: http://wrybread.com/photobooth |