【发布时间】:2016-02-29 04:39:15
【问题描述】:
我需要在每天的预定时间运行 PHP 脚本来更新数据库中的某些字段。我该怎么做?
我尝试使用 Windows 调度程序,但它没有运行我无法确定错误的脚本。
有没有教程或步骤可以帮助理解工作,以便进行配置。
我的蝙蝠档案:
H:\wamp\bin\php\php5.5.12\php.exe H:\wamp\www\file\file.php
测试 PHP 脚本:
<?php
$myfile = fopen("newfile.txt", "w") or die("Unable to open file!");
$txt = "John Doe\n";
fwrite($myfile, $txt);
$txt = "Jane Doe\n";
fwrite($myfile, $txt);
fclose($myfile);
?>
【问题讨论】:
-
使用 cron 作业。 cron job
-
请查看链接
标签: php cron wamp scheduled-tasks