I am trying to load a php script to run in the background using the exec()
function. My code looks like this:

<?
// ....

    $aqid = $db->insert_id();    //grab  id of newly inserted row
    $cmd = "php -q sendit.php $aqid >/dev/null 2>&1 &";
    exec("$cmd");                    // call sendit.php in background
// ...
?>

Basically, the point of me doing this is so the script runs in the
background so the member does not have to wait for the script to run after
they have clicked a send button. But they are still waiting because they
can't go to other pages until the script has completed running.

My next alternative will be to run a cron job to do this instead. But I
can't get cron working just yet.  Any suggestions to get the script to run
in background without stalling the script that calls it?

--
Nicole





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

Reply via email to