I am haviing issue in including file in php
`<?php
include "../../db/db_connection.php";`
Error
Warning: include(../../db/db_connection.php): Failed to open stream: No such file or directory in /var/www/html/practice/Blogs/actions/accounts/general.php on line 2
Here is my directories
I try to check it in terminal and the file is opened normally but giving error on the localhost
2
Answers
You need to use DIR, also you have only one level "../"
But it`s better to use require_once for config files
You may check you file location first,
include()
and its relatives take filesystem paths, not web paths relative to the document root.To get the parent directory
use ../