Drupal cron error: failed to open stream

Drupal cron error: failed to open stream

我已经像这样设置了我的 Drupal 7 cron 作业:

/usr/local/bin/php /home/myaccount/public_html/cron.php

但是,cron 向我发送了一封包含以下错误消息的电子邮件:

Warning: include_once(/home/myaccount/includes/bootstrap.inc): failed to open stream: No such file or directory in /home/myaccount/public_html/cron.php on line 13

Warning: include_once(): Failed opening '/home/myaccount/includes/bootstrap.inc' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/myaccount/public_html/cron.php on line 13

Fatal error: Call to undefined function drupal_bootstrap() in /home/tente myaccount studios/public_html/cron.php on line 14

cron 似乎以某种方式从路径中删除了 public_html。我上传了一个临时 PHP 文件并打印出 getcwd(),它正确地报告了路径,包括 public_html。因此,当 DRUPAL_ROOT 被定义为 getcwd() 时的第 11 行和调用 include 时的第 13 行之间的某处,有些东西从路径中删除了 public_html

您应该使用 curl 调用您的网络服务器,以便设置正确的 php.ini 和 open_basedir 指令。参见 https://www.drupal.org/cron