更新时间:2022-12-26 15:37:40
如果我们假设您要运行的脚本位于 /home/me/myscript.php
,那么您所需要做的就是创建一个cron作业
If we assume that the script that you want to run is located at /home/me/myscript.php
then all you need to do is create a cron job that will run that script every minute.
几个托管公司有一个接口(例如cPanel),可以轻松添加一个cron任务。您还可以通过编辑相关的cron作业并添加以下内容来添加cron任务:
Several hosting companies have an interface (cPanel for instance) that will allow you to add a cron task easily. You can also add the cron task by editing the relevant cron job and adding:
*/1 * * * * /usr/bin/php /home/me/myscript.php > /dev/null