如何在PHP中自动每天运行该函数 [英] How to run the function every day automatically in PHP

查看:68
本文介绍了如何在PHP中自动每天运行该函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想每天自动运行我的功能



我尝试过:

I want to run my function every day automatically

What I have tried:

推荐答案

定期运行PHP脚本的最简单方法是使用内置于操作系统中的内容;如果这是在Windows机器上你将使用任务调度,在Linux上你将使用CRON。



作为旁注,如果该PHP脚本在互联网上可见您可以在任何具有Internet访问权限的计算机上设置任务/作业。我已经利用其中一种免费的检查我的网站是否已启动程序,以便每小时点击一次脚本。
The easiest way to run a PHP script on a regular interval is going to be using what is built into the OS; if this is on a Windows machine you would use Task Scheduling, and on Linux you would use CRON.

As a sidenote, if that PHP script is visible on the internet you could set the task/job up on any computer with internet access. I've utilized one of the various free "check if my website is up" programs to hit a script hourly in the past.


这篇关于如何在PHP中自动每天运行该函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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