我正试图在2000台网络主机服务器上设置一个cron作业。
这是我使用的cron作业的命令行。它应该每小时刷新一次,但不会刷新(我设置了一个写数据库来检查)
注意:由于一些奇怪的原因,我无法更改"php -f /home/a2902119/“部分。
php -f /home/a2902119/public_html/database/KlassementRefresh.php
这是我要运行的php页面。
<?php
// Incudes
require_once '../includes/klassementFetcher.php';
//Clearing the Check Table
$con = mysqli_connect("url","host","pswd","user");
//Database Connection Check
if (mysqli_connect_errno($con)) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
break;
}
// Fetching Klassement
//H1 - H1P
klassementFetch("heren1k","http://kovv.mavari.be/xlsRangschikking.aspx?&reeks=H1");
//H2 - H3P
klassementFetch("heren2k","http://kovv.mavari.be/xlsRangschikking.aspx?&reeks=H3A");
?>
当我输入到php页面的链接时,一切都按它应该的方式工作,所以我很确定cronjob的定义有什么问题。
谢谢你帮我!
发布于 2013-09-23 09:34:46
将以下内容复制到文件中,将其保存为cron_caller.php PHP:
<?php
file_get_contents('http://night-city.comeze.com/cron.php');
?>
将该文件上载到'/public_html/‘文件夹中。
接下来,登录到000Webhost.com (http://members.000Webhost.com),为适当的站点选择“Go to cPanel”。
滚动到页面的底部,第二个面板,标签为“高级”,选择Cron。
在'php -f /home/a 1234567/‘的旁边,put _html/cron_caller.php
当您希望Cron激活时设置
然后单击Add
你就完蛋了。
https://stackoverflow.com/questions/18948650
复制相似问题