Jump to content

how to evalue that a program is still running in php script ?


jjk2

Recommended Posts

The execution of your script will wait for exec() to finish, so I'm not sure what your trying to get at really.

 

As for checking to see if something is running every 25 seconds, I'm not sure where your going here either. Maybe you need to run a cron every 25 seconds to see whats happening but really, this has little to do with php.

err i mean a shell excuted program is running.

 

i want the php background to check the output of this shell_exeC() or system()

 

to see if its finished.

 

$lastline = system(ls && sleep 10 && ls && sleep 10);

 

while ($output !== "Finished")

{

sleep(25)

echo "Still running"

}

 

the problem is that, it just waits until the commands are executed....i need to check on the fly what the shell program is outputting.

the problem is that, it just waits until the commands are executed....i need to check on the fly what the shell program is outputting.

 

You need to check the output of top, not try and execute the actual commands from php.

 

Honestly, im not sure php is the best tool for this job. You might need to explain in more details exactly what it is your trying to do.

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.