Re: Send process to background
| From: | Ed Lazor | Date: | Sat, 14 Oct 2006 00:53:52 +0000 |
| Subject: | Re: Send process to background | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-243114@lists.php.net to get a copy of this message | ||
On Oct 13, 2006, at 12:12 PM, Richard Lynch wrote:
On Fri, October 13, 2006 11:05 am, André Medeiros wrote:In unix, you can run something like this:I am working on a backup system that needs to be called through a webpage to start the process. I am trying to do this on a one-file-only sollution. The thing is, the first request to the site needs to start the backup, but I didn't want to use any command-line tools, since some of our servers rely on safe_mode. Is there any way to send output to the browser on this first instance, finish the request, but keeping the PHP running and making the backup.Probably not, at least not in a portable way. In *some* OS configurations this might work: <?phpbackup_script_here.xyz &;?> No promises.
script >& output.log &You can call something like that using PHP system calls. You might be stuck if safe_mode_exec_dir is locked down. You're especially screwed when you remove the option of using command-line tools. If you were to try to use PHP itself to manually get a directory listing, open each file, compress it, add it to an archive, etc., you're definitely going the wrong route.