note 48837 added to ref.exec
| From: | Kup at produman dot com | Date: | Sat, 08 Jan 2005 19:26:50 +0000 |
| Subject: | note 48837 added to ref.exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-82957@lists.php.net to get a copy of this message | ||
Just another simple example:
Executing php script in background:
<?
//example1.php
exec '/usr/local/bin/php "example2.php" "'.$param1.'"
"'.$param2.'" > /dev/null &');
?>
where
/usr/local/bin/php - php path
testbg.php - script to be executed
$param1, $param2 - parameters
> /dev/null - redirects the stdout to a file (disables waiting of stdout in example1.php)
& - executes script in background mode
IN example2.php use
<?
$param1=$_SERVER['argv'][1];
$param2=$_SERVER['argv'][2];
// to get parameters.
?>
Hope it'll help someone and sorry for my english :)
----
Manual Page -- http://www.php.net/manual/en/ref.exec.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+48837
Delete -- http://master.php.net/manage/user-notes.php?action=delete+48837&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+48837&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+48837&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+48837&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+48837&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+48837&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+48837&report=yes
Search -- http://master.php.net/manage/user-notes.php