RE: [PHP] How to launch a background task from a web page



hey tony...

in linux, using the "&" causes the process to run in the background.

do a quick search/test from google, and test using php, from the cmdline.

ie

php
<?
time1
a=`ls -al &`
time2
echo time2 - time1
?>

the above isn't correct, but you should get the idea...

once you've got the idea/process of running in the background down, you can
then check the same approach in the webapp...

have fun, and let us know how it goes..


-----Original Message-----
From: Tony Marston [mailto:tony@xxxxxxxxxxxxxxxxxxxxxxxx]
Sent: Thursday, October 30, 2008 9:39 AM
To: php-general@xxxxxxxxxxxxx
Subject: [PHP] How to launch a background task from a web page


I have some long running scripts which I need to launch from a web page and
have them run in the background, but which should not cause the web page to
wait until the script finishes. Reading the manual on the backtick and
exec() operators seems to imply that the PHP function will be suspended
until the script finishes, which is not what I want. Is this possible in
PHP?

--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

.



Relevant Pages

  • Re: [PHP] PHP console script vs C/C++/C#
    ... My script is taking a longer time to execute than I want. ... I prefer to write in PHP because that is what I know best. ... This is why I am thinking about rewriting my whole script in a C language. ... Perhaps there are different methods I could be using to speed up execution. ...
    (php.general)
  • Re: How to Add a Feeback Form
    ... I saw nothing in that script that indicates where the form is e-mailed to so ... Greg Maxey/Word MVP ... PHP or not. ... have the support available yet. ...
    (microsoft.public.frontpage.programming)
  • How best to show PHP source? (was: One page, multiple submit buttons)
    ... script to add to the top of a PHP script to enable showing its ... Maybe anybody submitting their own PHP code for critique here ... Anything posted to a newsgroup is a "snapshot" of what the ... there ought to be a FAQ for this ...
    (comp.lang.php)
  • Re: [PHP] PHP console script vs C/C++/C#
    ... My script is taking a longer time to execute than I want. ... I prefer to write in PHP because that is what I know best. ... thinking about rewriting my whole script in a C language. ... execution of the code. ...
    (php.general)
  • Email form script
    ... I have a web form that posts to a .php ... who cannot run .php on their server. ... Or does anyone have a .asp script that will ... Thank you for choosing FormToEmail by FormToEmail.com ...
    (microsoft.public.scripting.jscript)