dszsajhd237437 2016-11-24 08:34
浏览 20

如何在浏览器关闭后确保php页面正常工作

I have a PHP page which gets refreshed every 30 seconds. After every 30 secs, state is checked for some variables and if there is some change in the variables, another task is started. How do i ensure that my PHP continues to work i.e. refresh after every 30 secs even after I have closed my browser or have wind up for the day so that the script continues to work during night.

Please help and thanks in advance!

  • 写回答

1条回答 默认 最新

  • doureng5668 2016-11-24 08:38
    关注

    If the php is triggered by a web browser, the refresh will be triggered by the browser as well, and the program is not running when the browser is not requesting anything.

    If you have lower level access to the web server, you can create a cron job or other background task to run some of your code without depending on web browsers connecting to your server. Or perhaps you could start a background shell script from the php, but I'm not sure if that is allowed.

    评论

报告相同问题?

悬赏问题

  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度