Update:
The index.php file here:
/public_html/d/index.php
includes:
/public_html/d/core/source/class.File1.php
This Class.File1.php here has this include written like this:
include 'class.File2.php';
Naturally I put class.File2.php in the same directory as class.File1.php as noted above.
/public_html/d/core/source/class.File2.php
However,
It actually includes this file: ( notice the missing /d/ )
/public_html/core/source/class.File2.php
Not sure why it doesn’t use the file that is in the current directory.
But here are some possibilities.
Entry from a user requesting the page comes in to: ( user types www.host.com/d )
/public_html/d/
This has an include to: ( which works fine, I tested it )
/public_html/d/core/source/class.File1.php
However the include in that file is where things break as noted above:
include "class.File2.php"
The only thing that makes sense…is that includes are using some sort of internal constant like
ROOT
or
$_SERVER['DOCUMENT_ROOT']
but I still can’t figure out why it would ignore the /d/ but figure out the rest.
Are you using set_include_path anywhere in your app? Perhaps that could be the cause of your problem. By doing that you are specifying a list of directories where the require, include, fopen(), file(), readfile() and file_get_contents() functions look for files first.
As an alternative I suggest you define the absolute path to avoid problems.
Write this on your
/public_html/d/core/source/class.File1.php__FILE__and__DIR__are magic constants.__FILE__is a constant that has the absulute path to that specific file. And__DIR__is the absulte path to the directory where that file is. You can even test them by doingecho __FILE__;orecho __DIR__;You can read more about them here http://php.net/manual/en/language.constants.predefined.php