Answer the question
In order to leave comments, you need to log in
Why is the kernel (prolog_before.php) not connected when calling the script via cron?
When running the script by cron, $_SERVER['DOCUMENT_ROOT'] is empty, but redefinition and/or absolute paths for connecting the prologue do not help. At the same time, the script works correctly in the browser window. What could be the problem?
Answer the question
In order to leave comments, you need to log in
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Content-type: text/html; charset=utf-8");
header("Pragma: no-cache");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");
define("NO_KEEP_STATISTIC", true);
define("NOT_CHECK_PERMISSIONS", true);
if (!$_SERVER["DOCUMENT_ROOT"]) {
$_SERVER["DOCUMENT_ROOT"] = '/home/bitrix/www'; //тут укажите свой путь
}
require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php");
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question