D
D
Doniyor Mamatkulov2018-12-01 11:52:23
Yii
Doniyor Mamatkulov, 2018-12-01 11:52:23

Why is the path not found?

Hello!
Project on yii2 basic. Yii swears at non-existent path:

yii\base\View::main(): Failed opening required '/../layouts/_include/yandex-partner.php' (include_path='.;d:/ospanel/modules/php/PHP-7.1;d:/ospanel/modules/php/PHP-7.1/PEAR/pear')

I do the include like this:
<?php require "/../layouts/_include/yandex-partner.php"; ?>

The error occurs only on php version 7. Everything works on version 5.6. What could be wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yusif Zourab, 2018-12-01
@iLegion

Try specifying the path to the file relative to the site root. For example,

<?php require " $_SERVER['DOCUMENT_ROOT'] . /путь к файлу относительно корня/yandex-partner.php"; ?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question