A
A
Anton2020-04-24 19:34:40
PHP
Anton, 2020-04-24 19:34:40

Why can't I connect autoload.php?

5ea31496dfbc4885979303.png
Mistake

Fatal error: require_once(): Failed opening required 'root/vendor/autoload.php' (include_path='.:') in........

In code
<?
require_once($_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/main/include/prolog_before.php");
require_once 'root/vendor/autoload.php';
?>

Composer installed globally

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
FanatPHP, 2020-04-24
@FanatPHP

Learning the difference between absolute and relative paths
In this case, it is advisable not to enter the path hard, but to build from the current file using the built-in constant __DIR__

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question