You need to run Bitrix in the PHP console. But, of course, when you run the path like "/bitrix/header.php" and others, they are counted from the root of the file system, not the server, and the script does not start.

Tell me, please, how to get so messed up so that PHP can find all the paths correctly. Those. considered the root directory of the site. Or maybe there is some kind of special file to allow the bitrix to load in the console? Startup example:

$ php -f /var/www/mysite/index.php PHP Warning: require(/bitrix/header.php): failed to open stream: No such file or directory in /var/www/mysite/index.php on line 1

well, etc.

  • Everything is brilliantly simple =) Thank you for driving with DOCUMENT_ROOT !!! - TomaZ
  • Accept) I am glad that it helped, I myself am now trying to configure multidomain for 1% license) - Sh4dow

1 answer 1

If you are satisfied with exactly one specific file, create, for example, index2.php and fill in the $ _SERVER array ( DOCUMENT_ROOT and HTTP_HOST as a minimum), and then require 'index.php'; can ride.

Not sure what will work, immediately say.