A
A
Alex Sokol2020-05-06 13:14:54
1C-Bitrix
Alex Sokol, 2020-05-06 13:14:54

Why does the script from under the crown in Bitrix not work?

Why does the script from under the crown in Bitrix not work?
It does not work when I write this in the file before the script code
<?php
$_SERVER["DOCUMENT_ROOT"] = "/home/c/cok23/caytex.ru/public_html";
$DOCUMENT_ROOT = $_SERVER["DOCUMENT_ROOT"];
define("NO_KEEP_STATISTIC", true);
define("NOT_CHECK_PERMISSIONS", true);
define("BX_CRONTAB", true);
//set_time_limit(0);
define("LANG", "en");
define('CHK_EVENT', true);
set_time_limit(0);
ignore_user_abort(true); ?>
<? require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");?>

<? require($_SERVER["DOCUMENT_ROOT"]."/ bitrix /modules/main/include/prolog_before.php");?>
Without all this, everything works

does not work

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
PQR, 2020-05-06
@PQR

Try to use the full syntax to open the PHP code: <?php
So the last line should look like this:

<? require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");?>

The short syntax (only brace and question angles) is deprecated and depricated. It may work depending on the PHP settings on the hosting (adjusted by setting short_open_tag=On), but it's best to avoid it. The modern approach is to write in full: <?phpor<?=

K
Kontrael, 2020-05-08
@Kontrael

Remove these tags
5eb5180c9895a076139739.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question