Trouble with Exec

From: Date: Sun, 02 Feb 2003 10:01:32 +0000
Subject: Trouble with Exec
Groups: php.general 
Request: Send a blank email to php-general+get-133981@lists.php.net to get a copy of this message
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

« previous php.general (#133981) next »