|
-
May 2nd, 2007, 03:40 AM
#1
Thread Starter
Hyperactive Member
How to know PHP script is running on server or not ?
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.
-
May 2nd, 2007, 04:27 AM
#2
Re: How to know PHP script is running on server or not ?
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.
-
May 2nd, 2007, 10:34 AM
#3
Re: How to know PHP script is running on server or not ?
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|