dongqi9125 2013-09-12 03:07
浏览 14

我们可以使用htaccess每分钟运行php脚本而无需直接访问页面吗?

I'm developing website that will run php script every minute without access to that page directly. Almost people said that I have to used cron job; but my domain doesn't have function cron job to do like other domain. So what I want to know is can we use other methods beside of cron job? For example, htaccess. Does it is possible?

Thank in advance.

  • 写回答

1条回答 默认 最新

  • dsfdsf21312 2013-09-12 03:17
    关注

    I'm afraid the .htaccess file simply helps control Apache's configurations for your website. You can't launch jobs using that. Using cron is the best way to do what you want to do. If you don't have access to cron jobs, you could have a web page that controls that background worker by executing a shell command with like exec() or passthru() and manage the timer yoursel This is much more risky, since any error in your script might throw things off. You would have to manage the lifecycle of that background worker completely manually.

    Maybe there are other scripts out there that might do what you want, but forget the .htaccess file.

    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡等级和折扣规则
  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分