Cron作业执行PHP程序 [英] Cron job to execute a PHP program

查看:166
本文介绍了Cron作业执行PHP程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Linux服务器,在这里我想执行一个cron作业发送生日邮件给我的所有朋友一个PHP程序。我想创建一个从数据库读取数据并发送邮件的PHP程序。

I have a Linux server and in this I want to execute a cron job for sending birthday mail to all my friend with a PHP program. I want to create a php program that read data from database and send the mail.

我想知道cron job的命令,每天自动执行程序。我不知道Linux命令。

I want to know the command of cron job to execute the program on every day automatically. I have no knowledge of Linux commands.

推荐答案

你会想读一下crontab命令,您将这样做。

You will want to read up a little bit on the 'crontab' command but basically you will do this.

从linux命令提示符运行crontab命令。

From a linux command prompt run the crontab command.

* * * * * php yourscript/path

您可以通过修改*值来设置什么时间。有关信息,请参阅此网址:

You can set what time by modifying the * values. See this URL for information on that:

http: //adminschoice.com/crontab-quick-reference

这篇关于Cron作业执行PHP程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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