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.