我有一个PHP脚本可以做一些事情,拉上一些文件,然后启动 一个FTP进程。 我需要它在后台执行Zip和FTP,让页面完成 ,否则用户可以让那个页面在FTP完成时加载 20分钟。 /> 这就是我所拥有的: $ zipfile = $ order_po。" .zip"; exec(" /var/www/html/services/ftp.sh $ zipfile 2>& 1&",$ output2, $ status); echo"< div align =''center''class =''style1_hd''>您自动创建的ZIP文件 目前正在通过FTP发送!< / div>< ; / body>< / html>" ;; exit(); ?> (ftp .sh是FTP登录和传输脚本。) 你可以看到我有&使它成为一个后台进程,并且 将stdoutput发送到其他地方。 任何想法? 谢谢! 利亚姆
解决方案zipfile =
order_po。 ; .zip" ;; exec(" /var/www/html/services/ftp.sh
zipfile 2>& 1&" ,
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
解决方案 zipfile =order_po.".zip"; exec("/var/www/html/services/ftp.shzipfile 2>&1 &",更多推荐
在后台运行一个exec,让页面继续。
发布评论