在后台运行一个exec,让页面继续。

编程入门 行业动态 更新时间:2024-10-27 02:23:19
本文介绍了在后台运行一个exec,让页面继续。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个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.sh

zipfile 2>&1 &",

更多推荐

在后台运行一个exec,让页面继续。

本文发布于:2023-06-09 06:29:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/596859.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:后台   页面   exec

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!