Results 1 to 3 of 3

Thread: How to know PHP script is running on server or not ?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2006
    Posts
    266

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

  2. #2
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959

    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.

  3. #3
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    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
  •  



Click Here to Expand Forum to Full Width