NYCPHP Meetup

NYPHP.org

[nycphp-talk] call command-line script asynchronously

Rolan Yang rolan at omnistep.com
Sat Nov 10 09:02:56 EST 2007


If you're on a unix system, you can throw it into the background process 
like this:

<?php
print "starting a background job";
`/somewhere/out/of/the/www/tree/backgroundscript.php $yourparameters > 
/dev/null &`;
print "it's probably still running, but we're done here";
?>

~Rolan


Marc Antony Vose wrote:
> I'm confused.
>
> Which function for calling a command line script doesn't make your 
> script stop and wait?
>
> I want to make a web interface which triggers a command-line PHP 
> script that takes like 30 minutes to run, but I don't want the browser 
> sitting there waiting for it.
>
> I thought I did it right, but now the first time I run it for real, 
> it's hanging.
>
> Cheers,
>
> Marc
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
>
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php
>



More information about the talk mailing list