Forum Moderators: coopster

Message Too Old, No Replies

Is a large PHP script totally executed if I close my browser?

the PHP script updates 20,000 records

         

guarriman

10:08 am on Oct 30, 2007 (gmt 0)

10+ Year Member



Hi.

I created a PHP script which updated 20,000 records within a table and I execute it with my web browser.

It takes 1 hour to be executed, and sometimes I close my browser by mistake.

Is it totally executed? Thank you very much.

Habtom

10:17 am on Oct 30, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Though it is a Server Side script, it does stop being executed when the web browser is closed.

You can run it in the background safely using exec [php.net].

[edited by: Habtom at 10:58 am (utc) on Oct. 30, 2007]

OutdoorWebcams

4:50 pm on Oct 30, 2007 (gmt 0)

10+ Year Member



Habtom is right, but the script will be executed as long as the web server doesn't notice that your browser is closed (and assumes the presence of a valid connection).

So if your script doesn't output anything (or maybe a simple '...done' as the last line of your script), it will run until it's finished, even with your browser closed.

jatar_k

4:53 pm on Oct 30, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



how often does this have to be done? It may be worth looking at cron to run it if there is some kind of schedule to it.