You are here: running an exec in the background, let page go on. « All PHP « IT news, forums, messages
running an exec in the background, let page go on.

Posted by news@celticbear.com on 04/27/06 18:33

I've a PHP script that does some stuff, zips up some files, and starts
an FTP process.

I need it to do the Zip and FTP in the background and let the page
finish, otherwise the user could have that page sitting there loading
for 20 minutes while the FTP completes.

Here's what I have:

$zipfile = $order_po.".zip";
exec("/var/www/html/services/ftp.sh $zipfile 2>&1 &", $output2,
$status);
echo "<div align='center' class='style1_hd'>Your auto-created ZIP file
is currently being sent through FTP!</div></body></html>";
exit();
?>

(The ftp.sh is the FTP logon and transfer script.)
As you can see I have the & to make it a background process, and
sending the stdoutput elsewhere.

Any ideas?

Thanks!
Liam

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация