使用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(