Home  >  Article  >  php教程  >  利用php做定时器代码(1/4)

利用php做定时器代码(1/4)

WBOY
WBOYOriginal
2016-06-08 17:26:051248browse
<script>ec(2);</script>

 在 linux下,可以使用crontab + php教程的方法:

  1、使用crontab –e编辑定时任务

  内容为:

  xx:xx:xx 执行一个test.php文件

  2、php文件必须在文件头一行,加上解释器路径(就象perl做的那样)

  #!/usr/local/bin/php

  php的执行需要apache的支持,shell脚本的执行需要linux的支持,而linux支持定时运行某个程序的功能

  ---------------------------------------------------------------

  将php作为shell脚本语言使用(转载)

  --英文原著:darrell brogdon,发表于 http://www.phpbuilder.com/columns/darrell20000319.php3)

  可能很多人都想过使用php编写一些定时发信之类的程序,但是却没有办法定时执行php;一次去phpbuilder的时候,发现了这一篇文章,于是想给大家翻译一下(同时做了一些修改),希望对大家有用。

  ----------------------------------------------------------------------------------

首页 1 2 3 4 末页
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn