设置cronjob 000webhost [英] Setting up cronjob 000webhost
问题描述
我试图在000webhost服务器上设置一个cronjob。
I'm trying to set up a cronjob on the 000webhost servers.
这是我使用的cronjob的命令行。
它应该每个小时刷新,但它不(我设置一个写做我的数据库检查)
This is the command line for the cronjob I use. It should refresh every hour but it doesn't (I set up a write do my database to check)
注意:由于一些奇怪的原因,我可以' t更改php -f / home / a2902119 /部分。
NOTE: For some strange reason I can't change the "php -f /home/a2902119/" part.
php -f /home/a2902119/public_html/database/KlassementRefresh.php
这是我试图运行的php页面。
This is the php page I'm trying to run.
<?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页面的链接时,一切都像它应该的,所以我很漂亮
When I type in the link to the php page everything works like it should, so I'm pretty sure something's wrong with the cronjob's definition.
感谢您帮助我!
推荐答案
将以下内容复制到文件中,将其另存为cron_caller.php
PHP代码:
Copy the following into a file, save it as cron_caller.php PHP Code:
<?php
file_get_contents('http://night-city.comeze.com/cron.php');
?>
将此文件上传到/ public_html /文件夹。
Upload that file into your '/public_html/' folder.
接下来,登录000Webhost.com( http://members.000Webhost.com ),
Next, login to 000Webhost.com (http://members.000Webhost.com), select 'Go to cPanel' for the appropriate site.
滚动到页面底部,第二个面板,标记为高级,选择Cron作业。
Scroll towards the bottom of the page, second last panel, labelled Advanced, select Cron Jobs.
在放在public_html / cron_caller.php
Next to the 'php -f /home/a1234567/' put in public_html/cron_caller.php
当你想要Cron以激活
Set when you want Cron to activate
然后点击添加
完成操作。
这篇关于设置cronjob 000webhost的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!