首页 文章

Cpanel Cron作业没有在.php文件中执行代码

提问于
浏览
0

我需要在我的域名上运行特定网址

http://domain.com/?action=update_feed

,所以我制作了一个cron-file.php文件,其中包含以下代码:

<?php
header("Location: http://domain.com/?action=update_feed"); /* Redirect browser */
exit;
?>

在Cpanel的cron经理中,我添加了这个每分钟运行:

php -q /home/public_html/domain/wp-content/themes/theme/cron-file.php

然而,一切都没有发生 . 我也尝试使用wget而不是php但得到相同的结果 .

1 回答

  • 0

    您可以在没有cron-file.php的情况下直接访问您的站点

    wget -qO /dev/null 'http://domain.com/?action=update_feed'
    

相关问题