Hi,
I run a php file on server. I like to know whether that file is still running or not. Is there any possibility to know this ? Please help.
Thank you in advance.
Printable View
Hi,
I run a php file on server. I like to know whether that file is still running or not. Is there any possibility to know this ? Please help.
Thank you in advance.
As soon as you access a php script it is parsed and executed and then done with until its accessed again, if you mean is someone accessing a particular script you can either log the ip/referer of the incoming request or check the web server logs.
if you have a script that takes a long time to execute, you can use a database (or even just a text file) to keep track of when it is running or not running.
when the script starts, you connect to your database and send a query to set some value for that particular script to show as "running"; then, at the end of your script you can send another query to set the value to "finished running" or something similar.
generally, unless your script is doing a LOT of time-intensive stuff (lots of processing, downloading a file, pausing with sleep commands), then you won't even be able to notice the time between the start and end.