For a while I've been testing projects on a server and then uploading it to the correct folders. Recently I decided to try using XAMPP for increased security and less hassle when testing; so I installed it, imported the database and copied the files to the htdocs
folder.
Includes and requires seem to be working fine, but the one instance where it fails is when I try to access a parent folder, i.e. require "../file.php";
. I tried playing around a bit with the include_path
variable in php.ini
, but nothing seems to be working.
Any idea on what could be causing this, and how to fix it?
Many thanks in advance.
The file structure goes like this:
folderA/folderB/folderC
What I try to do is...
fileA
) in folderA
that includes a file (fileC
) in folderC
fileC
) in folderC
includes a file (fileB
) in folderB
Where apache seems to fail is when including fileB
from fileC
.
The code is as follows:
in fileA.php
: include "folderB/folderC/fileC.php";
in fileC.php
: require "../fileB.php";
My include_path
currently looks like this: include_path= ".;D:\xampp\htdocs\"