On the site there are two init.php files in different folders \ Bitrix \ php_interface \ init.php and \ local \ php_interface \ init.php in the Local folder works, and it does not work in the Bitrix folder, it does not output anything even if you put Log at the very beginning of the file. But I heard that two files work quite well. Question: Can two init.php work in different folders?
Answer 1
Bitrix connects init.php
in bitrix / modules / main / include.php
as follows:
if (file_exists (($ _ FName = $ _Server ["Document_root"]. "/ bitrix / init.php")) )
include_ONCE ($ _ FName);
if ((($ _ FName = GetLolocalPath ("php_interface / init.php", bx_personal_root))! == False)
Include_ONCE ($ _ Server ["document_root"]. $ _ FName);
if ((($ _ FName = GetLolocalPath ("php_interface /". Site_ID. "/ init.php", bx_personal_root))! == FALSE)
Include_ONCE ($ _ Server ["document_root"]. $ _ FName);
Where the getlocalpath ()
function is used, in which the Local
folder is determined, and if the folder is present, the file is taken from it. If the Local
folder is missing, the file from the Bitrix
folder is taken. So you will not use both files.
But (see first line) You can connect init.php, located at the root of the Bitrix
, as well as init.php
files located in the Local
folder.