使用php使用wget像cron一样单独运行文件? [英] Run a file seperately like a cron with wget using php?

查看:54
本文介绍了使用php使用wget像cron一样单独运行文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个拥有多个用户的网站,基本上,我想在用户做一些会影响自己和他人统计的事情时更新所有用户的统计信息.

现在,我只是将php文件包含在include_once()中,此方法有效,但是随着我获得更多用户,它花费了越来越多的时间.

有没有办法我可以运行进行更新的文件而无需用户等待它们完成?

谢谢!

I have a site that has several users, basically I want to update all the users stats when users do something that affect stats for themselves and others.

Right now I am simply including the php file with include_once() and this works but takes more and more time as I get more users.

Is there a way I can run the files that make the updates without having the user wait for them to finish?

Thanks!

推荐答案

我用了这样的东西

I used something like this


parts = parse_url(' http: //mysite.com/update.php'); // 这是您要在后台运行的文件
parts=parse_url('http://mysite.com/update.php'); //This is the file you want to run in the background


fp = fsockopen(
fp = fsockopen(


这篇关于使用php使用wget像cron一样单独运行文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆