Dears I´m having strange error on import files in PHP from another folders, I tryied dirname(__DIR__)
and gives ‘Uncaught Error: not found in D:/project/’.
Than I tryied with define(‘LIB’,’D:project’), and it continues giving error on use.
What to do
my project have this tree:
2
Answers
You sould try this
Use $_SERVER[‘DOCUMENT_ROOT’]
$_SERVER[‘DOCUMENT_ROOT’] will point to the main folder.
for example if the file is in project/fol/file.php project is the main folder, you can do it like this $root.’fol/file.php’
Example You dir
In PHP file
I Solved it, the issue is in xampp configuration file, it had a grant Access Subfolders: FALSE
I reinstall it.