Problem is very simple.. It would seem.

---

Error:

Warning: include(includes/navigation.php): failed to open stream: No such file or directory in C:\xampp\htdocs\sub\_page\about.php on line 27

Warning: include(): Failed opening 'includes/navigation.php' for inclusion (include\_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\sub\_page\about.php on line 27

---

I am redoing a site. Currently I am splicing it into PHP. Same way I have also ways done. Except this time I am making it more structured. Example of my code.

```
<!-- Start Navigation -->
<?php include 'includes/navigation.php'; ?>
<!-- End Navigation -->
<!-- Start Top Menu -->
<?php include 'includes/top_menu.php'; ?>
<!-- End Top Menu -->
<!-- Start Promo Menu -->
<?php include 'includes/pro_menu.php'; ?>
<!-- End Promo Menu -->

```

So lets that the file navigation is in includes folder which is located in the root. Lets say that the code above is on the services page which is '2' levels in. Not 1'. Typically i have it only '1' lvl of dir in so simply changing

```
<?php include 'includes/navigation.php'; ?>

```

to this

```
<?php include '../includes/navigation.php'; ?>

```

worked fine. 

The above code is on the services page which is located at 

/sub\_page/services/services.php

If i moved the services.php file from the above dir path to 1 lvl close to root like so

/sub\_page/services.php

and change the path on the include to 

```
<?php include '../includes/navigation.php'; ?>

```

it works fine. I need to be able to call the files from anywhere. Does anyone know how to do this? Thanks!

---

EDIT: Will use the following as an example. I was pulling a path error on this line

```
<?php include 'sub_page/about_us/includes/meta.php'; ?>

```

I was able to use the following instead

```
<?php include __DIR__ . "/includes/meta.php"; ?>

```

to fix it. However if i tried to add or take away a directory level from the path it would again return an error. The same thing will not work for any of the other lines/paths.

before

```
<?php include 'includes/navigation.php'; ?>

```

after

```
<?php include __DIR__ . "/navigation.php"; ?>

```

Any idea?