-1

when I include admin_functions.php file with this address:

 ../../functions/admin_functions.php 

it shows me these errors:

 Warning: include_once(../../functions/admin_functions.php): 
    failed to pen stream: No such file or directory 
    in D:\wamp64\www\CMS\admin\moduls\admin\add.php

and

Warning: include_once(): 
   Failed opening '../../functions/admin_functions.php' 
   for inclusion (include_path='.;C:\php\pear') 
   in D:\wamp64\www\CMS\admin\moduls\admin\add.php

But when I include this file with local address:

D:\wamp64\www\CMS\admin\functions\admin_functions.php

my project is running without any error.

I really checked that my first address isn't wrong and the both addresses are exactly the same file (admin_functions.php).

So whats wrong with that?

ceph3us
  • 7,326
  • 3
  • 36
  • 43
  • Hi, I think it would be helpful if you could add your portion of code with the `include_once` statement and some description of the (relative) directory layout you have (The tree command could be your friend for this.). My impression is that your relative include path is either malformed or not correct for the file you want to include. – Jakob Runge Sep 03 '16 at 14:10
  • See this : http://stackoverflow.com/questions/7378814/are-php-include-paths-relative-to-the-file-or-the-calling-code – Ehsan Chavoshi Sep 03 '16 at 15:10

1 Answers1

0

You must check that include_once(../../functions/admin_functions.php) has the right number of "../" to reach functions directory. Simple solution: try adding/removing "../" to your path until it works.

Blazeag
  • 481
  • 8
  • 13