O
O
ozornick2016-06-27 13:20:44
PHP
ozornick, 2016-06-27 13:20:44

PHPStorm how to fix "path not found" and "Include expression is not resolved"?

I think the situation is 99% familiar to everyone, but for some reason everyone is silent how to cope with this?
Let's say a project:

/home/user/www/domen.com/
app/
--class.php
--two_class.php
system/
--init.php
index.php

We actually do include app/class.php in the system/init.php file.
<?php
// Что-то вроде этого
define('ROOT', __DIR__ . '/app/');
include ROOT . 'class.php';

PHPStorm does not understand paths as the server sees it, everything is taken from the project root. But I would like a method in which the full path /home/user/www/domen.com/
__DIR__ __FILE__ also does not understand, but takes its own root.
What to do, I don’t start studying because of the IDE, just tin ..

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Kobzarev, 2021-06-30
@mihdan

Can just mute the error with a construct /** @noinspection PhpIncludeInspection */in PhpStorm

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question